[Calendar] tabulator as arrays

From: Date: Fri, 06 Feb 2004 11:03:23 +0000
Subject: [Calendar] tabulator as arrays
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-25526@lists.php.net to get a copy of this message
Hi, I have started to use Calendar in a project (so I hope I am not asking RTFM questions). It nicely helped me display a month overview using the "Calendar_Month_Weekdays" class. However I didnt really want to have the method calls inside my templates. I prefer to pass only scalars and arrays to my templates, just so that I dont start implementing too much logic in there :-) Anyways it would have been nice to get an array representation of the month by weekdays something like the following for the month of february 2004: $month = array( array(
    null, null, null, null, null, null, 1
) array(
    2, 3, 4, 5, 6, 7, 8
) array(
    9, 10, 11, 12, 13, 14, 15
) array(
    16, 17, 18, 19, 20, 21, 22
) array(
    23, 24, 25, 26, 27, 28, 29
) ) Also since you often display certain dates differently (like weekends, days where you have an event), it would be nice to be able to easily merge another array with that data. // array(1, 7, 8, 14, 15, 21, 22, 28, 29) $weekends = $month->getWeekends(); $month->mergeTypes($weekends, 'weekend') => $month = array( array(
    null, null, null, null, null, null, array(1, 'weekend')
) array(
    array(2, null), array(3, null), array(4, null), array(5, null), array(6, null), array(7, 'weekend'), array(8, 'weekend')
) .. ) also a method to hide (set to null) certain dates would be nice to $month->hideDates(array(3, 5)) => $month = array( array(
    null, null, null, null, null, null, 1
) array(
    2, null, 4, null, 6, 7, 8
) .. ) I hope some of these ideas are useful .. regards, Lukas Smith smith@backendmedia.com _______________________________ BackendMedia www.backendmedia.com berlin@backendmedia.com Linn Zwoch Smith GbR Pariser Str. 44 D-10707 Berlin Tel +49 30 83 22 50 00 Fax +49 30 83 22 50 07

« previous php.pear.dev (#25526) next »