月视图中的事件时间缩短

事件时间显示为 11a 和 3p,而不是 11am 和 3pm:

Screenshot 2025-11-07 at 11.54.31

问题似乎出在提供的数据上:

Screenshot 2025-11-07 at 11.57.33

1 个赞

将此移至功能,并希望从 @lindsey 获得一些建议

这里的修复非常简单:

diff --git a/plugins/discourse-calendar/assets/javascripts/discourse/components/full-calendar.gjs b/plugins/discourse-calendar/assets/javascripts/discourse/components/full-calendar.gjs
index 79940a66ba..22b9306052 100644
--- a/plugins/discourse-calendar/assets/javascripts/discourse/components/full-calendar.gjs
+++ b/plugins/discourse-calendar/assets/javascripts/discourse/components/full-calendar.gjs
@@ -79,6 +79,11 @@ export default class FullCalendar extends Component {
       timeZone: this.currentUser?.user_option?.timezone || "local",
       firstDay: this.firstDayOfWeek,
       displayEventTime: true,
+      eventTimeFormat: {
+        hour: "numeric",
+        minute: "2-digit",
+        meridiem: "short",
+      },
       weekends: this.args.weekends ?? true,
       initialDate: this.args.initialDate,
       height: this.args.height ?? "100%",

但 full calendar 在节约空间方面是刻意使用 narrow 缩写的。

我们能负担得起这里的额外空间吗?值得吗?

2 个赞

对空间的影响无论如何都很小——我们要么稍微缩短了时间,要么稍微缩短了事件标题。

在这种情况下,am / pma / p 对我来说都同样清晰。我们是否发现成员对此感到困惑?

2 个赞