0

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?

Jap Evans
  • 1,097
  • 8
  • 22
  • 42
  • Why would you need to do that? It's already obvious that it's May from the massive header saying "May 2021". Not sure you need to take up any more space in the cells with it. – ADyson May 19 '21 at 20:20
  • client requirements recommended by UI/UX team. :) – Jap Evans May 19 '21 at 21:16
  • 2
    Sounds somewhat less then essential to me, surely they can be persuaded? – ADyson May 19 '21 at 21:31
  • You _could_ go through with JS every time the calendar is rendered, select all the date cells by their CSS class and append the month value onto the text, I guess. If you had to. Dirty, but should work. – ADyson May 19 '21 at 21:32
  • You are right. I am going to push back. Thank you! – Jap Evans May 19 '21 at 21:43
  • On related note (or I will ask separate question if needed), any suggestion on implementing multiselect of days? dateClick is for just one day. User must be able to select (and color changes) multiple non consecutive days. – Jap Evans May 19 '21 at 21:46
  • Hm, [this](https://stackoverflow.com/questions/29181823/how-to-select-multiple-date-ranges-from-fullcalendar) might help - the syntax is for v3 but the concept would apply just as much to v4. – ADyson May 19 '21 at 22:00
  • @ADyson can you please help with this question https://stackoverflow.com/questions/67626993/fullcalendar-in-angular-get-selected-dates – Jap Evans May 20 '21 at 19:44

1 Answers1

0

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.

Remi
  • 4,663
  • 11
  • 49
  • 84
  • Some of the remarks here are irrelevant because content injection was only introduced in v5, but OP has tagged this question with v4. However you're correct that there's not really any clean way to do what the OP is asking (in any version). – ADyson May 19 '21 at 20:13