Angular 中的 FullCalendar - 更改 MonthView 中的日期格式

问题描述

我到处寻找并尝试了所有方法,但仍然无法找到正确的方法

我在 Angular 10 中使用以下版本。

"@fullcalendar/core": "^4.3.1","@fullcalendar/daygrid": "^4.3.0","@fullcalendar/interaction": "^4.3.0","@fullcalendar/moment": "^4.3.0","@fullcalendar/timegrid": "^4.3.0",

认月历将天数显示为“dd”,如 https://fullcalendar.io/demos

我想显示为 mm/dd(例如,5/19 表示 5 月 19 日)

我看到有 titleFormat、columnHeaderFormat、eventFormat,但是单元格中显示内容没有格式。

你能帮忙吗?

解决方法

我认为这不可能。

Date Formatting 页面对其他选项的描述不那么详细。 (...“和其他人”)

但是查看 DayCellContentDayCellRoot 的源代码,您可以看到不存在日期格式化程序。

理想情况下,日历对象上应该有一个类似于 dayHeaderFormat 的“dayCellDateFormat”属性,您可以使用 Formatting Function 根据需要设置日期格式。

最好的办法是在他们的 Github issue page 上提交功能请求。创作并不难,但他们应该认为这对其他人也是个好主意。