![]() |
Outlook-esque "Week View" Calendar - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Outlook-esque "Week View" Calendar (/showthread.php?tid=28532) |
Outlook-esque "Week View" Calendar - El Forum - 03-13-2010 [eluser]derekmichaeljohnson[/eluser] I'm attempting to create a week view calendar with 7 columns (days of the week) and 8 rows (work hours of the day 9am to 5pm). See this image for an example. How can I best create a model that would not only populate an array with the hours in a work day (9am to 5pm) but also assign any events (from the db) to that hour, if any? Example: Code: array( Thanks in advance! Outlook-esque "Week View" Calendar - El Forum - 03-14-2010 [eluser]Jondolar[/eluser] Hi derek, I wrote a calendaring program many moons ago. My technique was to create an array of all the hours that I wanted to be covered in the calendar by default. Then, query the database for all events of the day and assign each event to the proper array subscript. Code: $cal = array( This allows for multiple events per time slot. |