search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

How to set every Sunday and Bank Holidays as different colour.

Asked by Anonymous
10 years ago.

I have been trying to figure out how to can specify days and set there background colour. I have been trying different things like:

(Just to set Sunday as a different colour, this didn't set the background colour of all Sundays)

if (e.Start.DayOfWeek == DayOfWeek.Sunday)
{
e.BackgroundColor = "#000";
}

And then when I do this code to specify a cell it says it wont accept string...

if (e.Start.DayOfWeek == "12/06/2014")
{
e.BackgroundColor = "#000";
}

Then i have also tried passing it a DateTime but it has the same error but wont accept a DateTime.

string date = "12/06/2014";
DateTime dt = Convert.ToDateTime(date);

if (e.Start.DayOfWeek == "12/06/2014")
{
e.BackgroundColor = "#000";
}

Comment posted by Anonymous
10 years ago.

This is on the Day Pilot Month Pro sorry for not saying ...

Comment posted by Jaycee
10 years ago.

I'm not from daypilot but just giving suggestion, i think you can try this:

string date = "12/06/2014";
DateTime dt = Convert.ToDateTime(date);

if (dt==e.Start.Date)
{
e.BackgroundColor = "#000";
}

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.