I’m trying to figure out how to encode recurring events from my database but I miss some examples to know what goes into the different event fields for the following events:
- on Monday, June 20th, from 9:00 to 10:00 (not recurring)
- every Tuesday, from 11:00 to 12:00, starting on June 21st (recurring without end date)
- every Wednesday and Friday, from 13:00 to 14:00, starting on June 22nd, ending on June 30th (recurring event with end date)
I eventually found my answer by looking at the samples.
For those who would be looking for the same information:
- for recurring events, end_date contains the date and time of the last occurrence (if an end date was specified) and event_length contains the length of each occurrence in seconds
- for recurring events without an end date, end_date contains “9999-02-01 00:00:00” which must be like the maximum date
- for non-recurring events, end_date contains the actual end date and time of the event, event_length is 0 and rec_type is null
Now I am having difficulty to represent exceptions, something like “every monday from 9 to 5, exception June 20th”. Here is what I did in the sample:
- I created a recurring event that repeats every monday from 9 to 5
- I deleted just the one occurrence on Monday, June 20th
When I do that, a new record is inserted into the database with:
- event_pid=
- text=
- rec_type=none
- start_date/end_date=start and end date of the occurrence I’m deleting
But the mystery to me is the value that is stored in event_length: 1287712800 or something like that.
I don’t know how it is calculated, what is represents, but if I change it, even by one digit, my occurrence reappears in the calendar.
I need to know how to calculate that value because I’m storing and modifying my events in my database from another UI than dhtmlxScheduler.
It is exact start time (timestamp) of event which was deleted.
[code]new Date(1287712800*1000)
Fri Oct 22 2010 05:00:00 GMT+0300 (E. Europe Daylight Time)[/code]