user1765862 user1765862 - 3 months ago 22
CSS Question

selecting weekend days on bootstrap datetime control

I'm using bootstrap datetime control and I want to change weekend days color explicitly, so I tried to use

.bootstrap-datetimepicker-widget .weekend {
color: red;

but this way I'm selecting only Sunday and not Saturday, so I used approach I've found somewhere on stackoverflow

.bootstrap-datetimepicker-widget td:nth-last-child(1) {
color: red !important;

This way I'm able to select sunday and saturday but the problem is that I'm overriding also years, and months color on datetime control.

Is there a way to select only weekend days (saturday and sunday) using
bootstrap class?


Your first thing that you tried is the correct approach.

.bootstrap-datetimepicker-widget .weekend  {
color: red;

Please check if you have the css and script links in the order they are suppose too and that if there is not any other css that is overwriting it back or something. As a sample, please check the follow code pen which shows both saturdays and sundays in red color.

Hope this helps.