Thread: 'Universal' schedule table defintion
Anyone ever seen a table definition for schedules that could handle the following: 'Every 3rd Thurday, except for national holidays' 'from 8 AM to 10PM, closed 12-1pm and 6-7pm' 'The period of time Thursday the Xth, xxxx to Sunday the Yth, xxxx, 11am to 8pm Thursday and Friday, 8am to 6pm Saturday and Sunday' 'Monday thru Friday 10-3pm' (my kind of hours!) Obviously, I can do this with the strings above, but there is now way that the database could search for occurences of those using the strings, unless I come up with a special 'schedule language' and write a function to use in the select statement, (which I may have to do anyway).
I'd figure a look at some of those open source calendar/schedule/reminder programs might be helpful. You could try using yahoo calendars for some insight. You should be able to describe the repeating and nonrepeating stuff - monthly, weekly, every X day, every X etc. But I have no idea how one would do stuff like new moon sightings (start/end of Muslim fasts - national holidays in some places) though, especially when it could depend on local atmospheric conditions where the official sighting is done. So I figure you'd always need a text field for notes e.g. "subject to change". Universal looks difficult to me. Link. At 03:08 PM 2/13/03 -0800, Dennis Gearon wrote: >Anyone ever seen a table definition for schedules that could handle the >following: > >'Every 3rd Thurday, except for national holidays' >'from 8 AM to 10PM, closed 12-1pm and 6-7pm' >'The period of time Thursday the Xth, xxxx to Sunday the Yth, xxxx, > 11am to 8pm Thursday and Friday, 8am to 6pm Saturday and Sunday' >'Monday thru Friday 10-3pm' (my kind of hours!) > >Obviously, I can do this with the strings above, but there is now way that >the database could >search for occurences of those using the strings, unless I come up with a >special 'schedule >language' and write a function to use in the select statement, (which I >may have to do anyway). > > > >---------------------------(end of broadcast)--------------------------- >TIP 5: Have you checked our extensive FAQ? > >http://www.postgresql.org/users-lounge/docs/faq.html
On Thursday 13 Feb 2003 11:08 pm, Dennis Gearon wrote: > Anyone ever seen a table definition for schedules that could handle the > following: > > 'Every 3rd Thurday, except for national holidays' > 'from 8 AM to 10PM, closed 12-1pm and 6-7pm' > 'The period of time Thursday the Xth, xxxx to Sunday the Yth, xxxx, > 11am to 8pm Thursday and Friday, 8am to 6pm Saturday and Sunday' > 'Monday thru Friday 10-3pm' (my kind of hours!) > > Obviously, I can do this with the strings above, but there is now way that > the database could search for occurences of those using the strings, unless > I come up with a special 'schedule language' and write a function to use in > the select statement, (which I may have to do anyway). Two suggestions: 1. Explore "man crontab" for possibilities. If nothing else you'll be able to explain it in the technical docs by saying "it's like crontab" 2. Even with (1) you're looking at sets of rows to represent some of the above, I'd have a column with values of ADD|SUBTRACT to overlay rows and produce the final pattern. Best of luck, and I'd be interested in how well your choice works out for you. -- Richard Huxton
> I'd figure a look at some of those open source calendar/schedule/reminder > programs might be helpful. You could try using yahoo calendars for some > insight. This could be an interesting project. > But I have no idea how one would do stuff like new moon sightings I guess that this can only be handled by a holiday table to be joined against. -- Kaare Rasmussen --Linux, spil,-- Tlf: 3816 2582 Kaki Data tshirts, merchandize Fax: 3816 2501 Howitzvej 75 Åben 12.00-18.00 Web: www.suse.dk 2000 Frederiksberg Lørdag 12.00-16.00 Email:kar@kakidata.dk
That's how I will do the holidays. And I'll probably have a 'type' indicator for the holiday, for example: 'US Official', 'Muslim', blah blah. 2/14/2003 2:52:52 AM, "Kaare Rasmussen" <kar@kakidata.dk> wrote: >> I'd figure a look at some of those open source calendar/schedule/reminder >> programs might be helpful. You could try using yahoo calendars for some >> insight. > >This could be an interesting project. > >> But I have no idea how one would do stuff like new moon sightings > >I guess that this can only be handled by a holiday table to be joined >against. > > -- >Kaare Rasmussen --Linux, spil,-- Tlf: 3816 2582 >Kaki Data tshirts, merchandize Fax: 3816 2501 >Howitzvej 75 Åben 12.00-18.00 Web: www.suse.dk >2000 Frederiksberg Lørdag 12.00-16.00 Email:kar@kakidata.dk >