# 即将到来的事件日历中的重复事件未能处理夏令时更改

**URL:** <https://meta.discourse.org/t/recurring-events-in-upcoming-events-calendar-fail-to-handle-daylight-saving-change/380712>\
**Category:** Bug\
**Tags:** events\
**Created:** [2025年八月28日 09:39 UTC](https://meta.discourse.org/t/recurring-events-in-upcoming-events-calendar-fail-to-handle-daylight-saving-change/380712 "2025-08-28T09:39:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)\
**Post date:** [2025年八月28日 09:39 UTC](https://meta.discourse.org/t/recurring-events-in-upcoming-events-calendar-fail-to-handle-daylight-saving-change/380712/1 "2025-08-28T09:39:53Z")

</div>

当一个周期性事件跨越一个夏令时状态到另一个状态时，事件在“即将发生的事件”日历中的时间似乎会改变一个小时。即使事件和查看“即将发生的事件”日历的用户具有相同的时区，也会发生这种情况。

一个简单的重现方法是创建一个具有以下 Markdown 的事件主题（您可能需要更改 Markdown 中的 `timezone` 值为您自己的，或者为了重现问题而将用户的时区设置为 `America/Los_Angeles`）。

```markdown
[event start="2024-11-01 10:00" status="public" name="Example" url="https://discourse.org" timezone="America/Los_Angeles" recurrence="every_week" minimal="true" end="2024-11-01 11:00"]
[/event]

```

创建事件后，在您的实例上转到 `/upcoming-events/week/2025/10/27`。事件将显示在正确的时间。如果您向前移动一周（夏令时结束的那一周），事件将提前一小时显示。

---

<div class="post-metadata">

**Author:** ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)\
**Post date:** [2025年八月28日 12:55 UTC](https://meta.discourse.org/t/recurring-events-in-upcoming-events-calendar-fail-to-handle-daylight-saving-change/380712/2 "2025-08-28T12:55:36Z")

</div>

这应该作为一项更大的修复的一部分进行修复：

> <https://github.com/discourse/discourse/commit/249ae0009ac208ecf5c49dd29db8ded4d244fc75>
>
> This commit removes the \`include\_expired\` param and its associated site
> setting …\`include\_expired\_events\_on\_calendar\`.
> 
> Since recent changes this performance optimisation doesn’t make sense
> anymore as we only load the events needed for a specific before/after
> range.
> 
> The rules are the following:
> 
> Non recurring events:
> \- They have to have a start date between before/after range
> 
> Recurring events:
> \- they don't have event\_dates, so we don't rely on it for them
> \- what's important for recurring\_event, is the recurring\_until property
> and the original starts at
> \- we want to return recurring events when their start date is is after
> the after param and the before param is before the recurring\_until
> \- if recurring\_until is NULL we just look at the start date
> 
> It's done this way as the serializer only sends the rrule to the front,
> and this is the frontend which will compute the recurring events, but if
> you want to have all the events of august, and your recurring event is
> starting in june, you need to also fetch this june event.
> 
> This commit ensures we can now deal properly with nil dates as it makes
> no sense to have dates for an expired recurring event.

我在本地进行了测试，但如果对您不起作用，请告知。

---

<div class="post-metadata">

**Author:** ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)\
**Post date:** [2025年八月29日 01:21 UTC](https://meta.discourse.org/t/recurring-events-in-upcoming-events-calendar-fail-to-handle-daylight-saving-change/380712/3 "2025-08-29T01:21:07Z")

</div>

我确认这解决了问题 🎉 谢谢 Joffrey！

---

<div class="post-metadata">

**Author:** ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)\
**Post date:** [2025年八月29日 01:21 UTC](https://meta.discourse.org/t/recurring-events-in-upcoming-events-calendar-fail-to-handle-daylight-saving-change/380712/4 "2025-08-29T01:21:20Z")

</div>


