如何阻止日历 bbcode 中的智能日期?

我希望能够将日期显示为星期几。使用 dddd 时,如果日期至少在一周之后,效果正常:

Saturday

[date=2025-11-01 time=18:00:00 timezone="Europe/Madrid" format="dddd"]

但如果日期是昨天或在未来 48 小时内,则会显示时间以及“昨天”、“今天”或“明天”:

- [date=2020-10-31 time=18:00:00 timezone="Europe/Madrid" format="dddd"]
- [date=2020-11-01 time=18:00:00 timezone="Europe/Madrid" format="dddd"]
- [date=2020-11-02 time=15:00:00 timezone="Europe/Madrid" format="dddd"]
- [date=2020-11-03 time=15:00:00 timezone="Europe/Madrid" format="dddd"]

有没有办法禁用这种智能行为?

我之前在 这个帖子 中问过这个问题。

简短的回答是输入“calendar=off”这几个词。

[ date=2020-11-01 time=11:10:00 timezone="America/Chicago"calendar=off ]

2020-11-01T17:10:00Z

非常感谢你的提问(并分享出来)。:blush:

我找到了这里的测试:

https://github.com/discourse/discourse/blob/master/plugins/discourse-local-dates/test/javascripts/lib/local-date-builder-test.js.es6#L304

我都不知道还有这么多其他选项::sweat_smile:

  • 时区
  • displayedTimezone
  • 倒计时