Distinguish Saturday from Sunday.

1 Answer 20 Views
Calendar DatePicker
fingate
Top achievements
Rank 1
Iron
fingate asked on 05 Mar 2024, 02:00 AM

Hi!

I have a question.

I would like to mark Saturday in blue and Sunday in red.
The only information I have is the 'k-weekend' class that doesn't seem to distinguish Saturday from Sunday.

Is there a simple way to distinguish it?

 

 

I don't want to mess with props if possible.

 

 

 

 



Thanks for reply

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1 Answer, 1 is accepted

Sort by
1
Accepted
Vessy
Telerik team
answered on 07 Mar 2024, 05:41 PM

Hello, fingate,

You are right that the day groups in the calendar does not have their specific classnames, but you can easily style all sundays and Saturdays by accessing the 6th and 7th child of the `.k-calendar-tbody tr` elements.

For example, you can use a similar selector (note that it will style also the empty cells at the bottom of the month):

.k-calendar-tbody td:nth-child(6) {
  background-color: skyblue;
}
.k-calendar-tbody td:nth-child(7) {
  background-color: pink;
}

I hope this suggestion will be helpful for you .

Regards,
Vessy
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources

fingate
Top achievements
Rank 1
Iron
commented on 11 Mar 2024, 12:24 AM

Thanks for reply.
It's a simple method I want !

Vessy
Telerik team
commented on 11 Mar 2024, 08:45 AM

You are welcome, I am glad that the suggested approach is working for you :)
Tags
Calendar DatePicker
Asked by
fingate
Top achievements
Rank 1
Iron
Answers by
Vessy
Telerik team
Share this question
or