Search code examples
angularfullcalendarfullcalendar-4primeng-calendar

FullCalendar in Angular - changing the day format in MonthView


I have looked everywhere and tried everything but still unable to find the proper way to do this.

I am using the following versions in 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",

The default month calendar shows days as 'dd' like shown in https://fullcalendar.io/demos

I want to show as mm/dd (e.g., 5/19 for May 19th)

I see there is titleFormat, columnHeaderFormat, eventFormat but there is no format for what is shown in the cells.

Can you please help?


Solution

  • I don't think it's possible.

    The Date Formatting page isn't that descriptive with what the other options are. (..."and others")

    But looking at the source code of DayCellContent and DayCellRoot you can see there isn't a date formatter present.

    Ideally there'd be a 'dayCellDateFormat' property on the Calendar object similar to dayHeaderFormat on what you could use a Formatting Function to format the date as you wish.

    Your best bet would be to file in an feature request on their Github issue page. It isn't that difficult to create but they should think it's a good idea for others as well.