Our powerful JS Calendar component


Post by sbprot »

Hi,

I would like to change the format of the days displayed in the "day header" to show the full name of the day (for example, "Monday" instead of "Mon" or "Thursday" instead of "Thu").

2023-12-04.png
2023-12-04.png (4.29 KiB) Viewed 494 times

I tried doing this :

dayNameFormat: 'dddd'

but it doesn't work. If possible, I would also like to implement logic that displays either the full name or the abbreviated name based on a condition. Perhaps I can use the dayHeaderRenderer() function for this? I've also tried using it, but nothing changes either...

Thank you for your help!


Post by Animal »

It's this bug: https://github.com/bryntum/support/issues/6441

Responsive runs late at first paint time and its opinions override configuration:

Screenshot 2023-12-04 at 16.42.50.png
Screenshot 2023-12-04 at 16.42.50.png (333.36 KiB) Viewed 489 times

Post by Animal »

A hacky workaround would be to set it after instantiation and rendering of the calendar. Icky, but will work:

Screenshot 2023-12-04 at 16.47.05.png
Screenshot 2023-12-04 at 16.47.05.png (326.68 KiB) Viewed 489 times

Post by sbprot »

It doesn't work very well, I have to change the date to show the full day name, the first "load" shows the abbreviated names.

I will wait for the bug to be fixed !

Thanks for the help !


Post by marcio »

Thanks for letting us know and for your patience, we hope to fix the bug soon! :)

Best regards,
Márcio


Post by Animal »

It's a very easy workaround:

    modes : {
        week : {
            allDayEvents : {
                onPaint({ firstPaint }) {
                    firstPaint && (this.dayNameFormat = 'dddd');
                }
            }
        }
    }
Screenshot 2023-12-04 at 18.01.14.png
Screenshot 2023-12-04 at 18.01.14.png (218.14 KiB) Viewed 471 times

Post by Animal »

A more correct fix which works with the Responsive mixin would be

    modes : {
        week : {
            allDayEvents : {
                // Override the Responsive mixin's opinions about the default dayNameFormat
                responsive : {
                    '*' : {
                        dayNameFormat : 'dddd'
                    }
                }
            }
        }
    },

Post Reply