![]() |
Coloring today and week-end in a calendar...
Good day to you all,
I'm working on a calendar script. I'm facing 2 questions; 1. How, if is this month, can I have the day in a different color ? 2. how could I have the Saturday and Sunday show in different color ? Here is my code: PHP Code:
|
I foud it thanks you !
PHP Code:
|
Haven't tested it though, but it looks correct! ^^
|
Peuplarchie: you might also want to check the year.
PHP Code:
becomes: PHP Code:
|
I created a calendar class for TalkPHP. Although I never released it. I should do as it's very in-depth! The function I used for detecting if it is the weekend or not, is the following:
php Code:
The member variable $this->m_iDate is nothing more than a UNIX timestamp. This can obviously be created using time()! Perhaps somebody knows of a better way, however. In which case, I would love to hear it, as I love dealing with dates. |
Wouldn't this be easier Wildhoney?
PHP Code:
mktime here. Also, I prefer to use integers for days (like monday = 1, sunday = 7). |
| All times are GMT. The time now is 07:48 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0