Re: calendar

From: Date: Thu, 13 Jan 2005 10:29:22 +0000
Subject: Re: calendar
References: 1 2 3  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-16910@lists.php.net to get a copy of this message
I'm not a programmer but have enjoyed many benefits of the Open Soucre movement, primarily FreeBSD, Apache, PHP, mySQL, PHPwebsite which uses quite a bit of the Pear stuff. However I'm having trouble with the calendar thing. I took what I thought would be the easier of two, changing the start day, but with out success. $Year = new Calendar_Year($_GET['year']); added this after the above line in 12.php $sDates = array(); //some selected dates $firstDay = 0; //sunday $Year->build($sDates, $firstDay); commented out this line //$Year->build(); Tried several numbers for $firstDay. Not sure if I need something in the array for $sDates. Thought it would change the start day regardless. I'm assuming dates in the array would be tagged dates that could be used to change the background color for the days in the array. But not sure of the required syntax. Bottom line is if you will create this to be added as a sample to the calendar package I will make a $50 contribution to your cause. Not so much because I need it that bad, realize that not a lot of money either, but in return for the benefits I have enjoyed from the Open Source movement. Sample will be as 12.php with necessary addition to change start day of the month and some dates added to show how to change the background color for those dates. Thanks Paul > Hi, > > yawstick wrote: > > I've been experimenting with the calendar package and have a few questions. > > Mainly trying to hack the sample 12.php to have color coded weekdays for a > > work schedule where I work. > > if ($Day->isEmpty()) { > echo "<td>&nbsp;</td>\n"; > } else { > echo "<td > class='busy'>".$Day->thisDay()."</td>\n"; > } > > then define a CSS class called "busy" > > > > How do you change the first day of the week in this sample > > $sDates = array(); //some selected dates > $firstDay = 0; //sunday > $Year->build($sDates, $firstDay); > > > I've looked at 20.php with the payload but need something similar for the > > whole year but only want to change background colors of the days. Is there > > an easier way of going about this? > > @see above > > $sDates <= array of selected dates > > then check if $Day->isEmpty(); > > > HTH > > -- > Lorenzo Alberton > http://pear.php.net/user/quipo > > -- > PEAR General Mailing List (http://pear.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.pear.general (#16910) next »