Skip to content

Commit

Permalink
Repeat events are now created correctly even if the DST change boundary
Browse files Browse the repository at this point in the history
is crossed between repeats.
  • Loading branch information
defacer committed Aug 23, 2005
1 parent e796d82 commit 44525c6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions calendar/event.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,14 @@

if ($form->repeat) {
for($i = 1; $i < $form->repeats; $i++) {
// [pj]
// This will not necessarily work correctly because of DST
$form->timestart += 604800; // add one week
// What's the DST offset for the previous repeat?
$dst_offset_prev = dst_offset_on($form->timestart);

$form->timestart += WEEKSECS;

// If the offset has changed in the meantime, update this repeat accordingly
$form->timestart += $dst_offset_prev - dst_offset_on($form->timestart);

/// Get the event id for the log record.
$eventid = insert_record('event', $form, true);
/// Log the event entry.
Expand Down

0 comments on commit 44525c6

Please sign in to comment.