# 🌍 新日历功能：显示本地时间

**URL:** <https://meta.discourse.org/t/new-calendar-feature-show-local-time/368608>\
**Category:** Announcements\
**Tags:** events\
**Created:** [2025年六月2日 20:54 UTC](https://meta.discourse.org/t/new-calendar-feature-show-local-time/368608 "2025-06-02T20:54:30Z")\
**Posts on this page:** 1\
**Showing post:** 26

<div class="post-metadata">

**Author:** ![yuriy](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yuriy/32/498097_2.png) [@yuriy](https://meta.discourse.org/u/yuriy)\
**Post date:** [2025年六月23日 13:51 UTC](https://meta.discourse.org/t/new-calendar-feature-show-local-time/368608/26 "2025-06-23T13:51:44Z")

</div>

我们已准备好合并第一个 PR。虽然不是最理想的，但修复边缘情况（如我[上一篇帖子](https://meta.discourse.org/t/new-calendar-feature-show-local-time/368608/25?u=yaran)中所列）可能会随之而来。

> <https://github.com/discourse/discourse-calendar/pull/745>
>
> This PR overhauls the way event dates are rendered by applying context-aware for…matting rules:
> \* Single-day events only show times when appropriate, hiding “12:00 AM” for events without \`endDate\`.
> \* Multi-day ranges omit redundant parts (e.g. for the current year) and include weekday/month/day when needed.
> 
> \### Tests added
> \* Weekday-only ranges (e.g. “Friday → Monday”)
> \* Same-week and same-month spans (omitting year)
> \* Cross-month and cross-year spans (including year where needed)
> \* \`Today/Yesterday/Tomorrow\` labels with time ranges
> \* Same-day events showing only time ￼
> 
> \### Impact
> \* Improves readability of event dates across the app
> \* Reduces visual noise by hiding redundant date/time fragments
> \* Ensures consistency with user expectations around relative dates
> 
> \### Things to clarify
> 
> \* Relative labels (\`Yesterday, Today, Tomorrow\`) replace literal dates for nearby days.
> \* Timezones are only shown when \`showLocalTime\` is toggled.
> 
> \### Discussion
> 
> https://meta.discourse.org/t/new-calendar-feature-show-local-time/368608/

---

_[View the full topic](https://meta.discourse.org/t/new-calendar-feature-show-local-time/368608)._
