[eluser]JamesTaylor[/eluser]
I'm working with the calendar class and need some help with how to manipulate dates which i'm pulling from a DB into an array which i can pass to the calendar to display.
From my database i'm grabbing dates when a property (a house) is unavailable / booked. My example data is as follows and is currently in a variable called $booked in the controller:
Code:
Array (
[0] => Array ( [From] => 2010-10-15 [To] => 2010-10-20 )
[1] => Array ( [From] => 2010-10-25 [To] => 2010-10-30 )
)
As you can see the i'm working with dates in October for this example. I need to extract the dates in October when the property is unavailable so they can be displayed on the calendar.
What i need to end up with in accordance with the calendar class is an array which would look like the following:
Code:
Array (
[15] => 'booked',
[16] => 'booked',
[17] => 'booked',
[18] => 'booked',
[19] => 'booked',
[20] => 'booked',
[25] => 'booked',
[26] => 'booked',
[27] => 'booked',
[28] => 'booked',
[29] => 'booked',
[30] => 'booked'
)
How would i best go about doing this?
Thanks
James