Colors for weekends and today

5 views
Skip to first unread message

Kris

unread,
Feb 12, 2010, 5:04:28 PM2/12/10
to Ajax Availability Calendar
Can you set a different background color for saturday and sunday.

And maybe also a different background color for the current day (this
is really hard to see for the moment). Still thinking how this would
work then with booked days ...

cbolson

unread,
Feb 13, 2010, 4:55:05 AM2/13/10
to Ajax Availability Calendar
Hi,
As you say, the problem with having different background colors for
the weekends is how that would work with the booking states.
On a "simple" bookings calendar with only a couple of states this is
not so much of a problem as you can create special classes and images
for the weekend days. However as this calendar can have unlimited
states, I am not sure that this is a reasonable solution.

As with the current day, I think that the best method is to use the
borders.
I don't know if you have actually looked through the php function that
actually creates the calendar, but if you do you will see that infact
the weekend days are already marked with an extra class "weekend".
Also, in the css file this class exists however with no styles
attached (atuall just checked it and it has a border style commented
out). So, to highlight the weekend days you just need to modify this
class :)

I hope that helps :)

Chris

rcph

unread,
Feb 13, 2010, 5:09:55 AM2/13/10
to Ajax Availability Calendar
My solution

function.inc.php:
// add weekend class - used in javascript to alter class or set
opacity
$getdate=getdate($date_timestamp);
$day_num=$getdate["wday"]+1;
if ($day_num % 7 == 1) $day_classes.=' nedele';
elseif ($day_num % 6 == 1) $day_classes.=' sobota';

avil-calendar.css:
.cal_month ul li.nedele { border:1px dotted #C33; }
.cal_month ul li.sobota { border:1px dotted #66F; }
.cal_month ul li.today { border:1px solid #0F0; }

Petr

cbolson

unread,
Feb 22, 2010, 3:40:47 AM2/22/10
to Ajax Availability Calendar
The code is already in there for highlighting weekend days, you only
need to add a border style to the class "weekend" in the css file.

However, I see from your code that you have actually have set
different styles for Saturday and for Sunday so your use is clearly
differant :)

Chris

Reply all
Reply to author
Forward
0 new messages