Our powerful JS Calendar component


Post by licjapodaca »

Is there a way to get a css class on the week day name for today date?

today-css-class-in-weekdayname.png
today-css-class-in-weekdayname.png (248.14 KiB) Viewed 516 times

I want to color the number today date but the week day name of today date too ... Is there a way to set a calendar property to include a css class in the week day name for today date ? ...

Regards


Post by alex.l »

No build-in properties for that, but doable using https://bryntum.com/docs/calendar/api/Calendar/widget/MonthView#config-headerRenderer

A function (or the name of a function) which creates content in, and may mutate a day header element. The following parameters are passed:

cell HTMLElement The header element.
day Number The day number conforming to the specified weekStartDay. Will be in the range 0 to 6.
weekDay Number The canonical day number where Monday is 0 and Sunday is.

All the best,
Alex


Post by licjapodaca »

Hi @alex, and how do I affect the content text in that function headerRenderer ? just using a:

...
headerRenderer: function(cell, day, weekDay) {
   // logic ...
   return 'Test';
}
...

Regards


Post by mats »

 cell.innerHTML = 'foo'

Post by licjapodaca »

Excellent 👍🏻 ... thanks @mats


Post Reply