Calendars
Emmanuel. M. Decarie
emm at scriptdigital.com
Thu Feb 28 14:32:31 PST 2002
> > One of the features that seems to be missing from all of them, including
>the
>> PHP events calendar this example is based on, is events greater than a
>days
>> length.
>
>Resource booking and Gant chart display were what I really needed out of the
>calendar. Unfortunately I haven't got that far with the project yet.
>
>How to, *efficiently*, tell whether a resource is booked *at any given time*
>is a problem that I'm still a little fuzzy on. A booking start date could be
>years away from the date being displayed or queried against, yet would still
>have to be picked up. My current planned solution is to set a minimum number
>of flags[1] stemming from the start time. For example, a resource booked for
>all of 2002, Jan 2003, and Feb 1, 2003 could get away with three flags set
>in the appropriate year, month, and day tables. These flags could then be
>adjusted when changes were made to the schedule. The date and time tables
>could be traversed up to check the availability of a resource at a given
>time. Minute --> Hour --> Day --> Month --> Year, no flags, it must be free.
>
>Is there a more simple or a conventional way of dealing with this? Are there
>any inconsistencies in my logic? Any comments on or off list would be
>welcome.
IMO, you take the problem backward. Instead of looping through a
calendaring structure to find resource booked, you could just create
a table with unique id for each resource that can be booked and put
the booking date there. So when you build the calendar, the script
check this table to see when a resource is booked and if it need
modification.
HTH
--
______________________________________________________________________
Emmanuel Décarie / Programmation pour le Web - Programming for the Web
Frontier - Perl - Javascript - XML <http://scriptdigital.com/>
More information about the Frontier-Users
mailing list