diff options
author | Arturo Espinosa <unammx@src.gnome.org> | 1999-03-11 09:35:52 +0800 |
---|---|---|
committer | Arturo Espinosa <unammx@src.gnome.org> | 1999-03-11 09:35:52 +0800 |
commit | 20bba8a8f67d1e347d00748b03908f948c2be6b7 (patch) | |
tree | 0b11710b8773a51ec11385af05606aa80332f303 /calendar/pcs | |
parent | 1b383b0fa71f05423f333fc0afcd049a643dca74 (diff) | |
download | gsoc2013-evolution-20bba8a8f67d1e347d00748b03908f948c2be6b7.tar.gz gsoc2013-evolution-20bba8a8f67d1e347d00748b03908f948c2be6b7.tar.zst gsoc2013-evolution-20bba8a8f67d1e347d00748b03908f948c2be6b7.zip |
1999-03-10 Craig A Soules (soules+@andrew.cmu.edu)
* timeutil.c, calendar.c, calobj.c, gncal-day-panel.c: Add support
for daylight time savings.
svn path=/trunk/; revision=756
Diffstat (limited to 'calendar/pcs')
-rw-r--r-- | calendar/pcs/calobj.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/calendar/pcs/calobj.c b/calendar/pcs/calobj.c index 6ed9db187a..db27f8abd3 100644 --- a/calendar/pcs/calobj.c +++ b/calendar/pcs/calobj.c @@ -1030,12 +1030,22 @@ generate (iCalObject *ico, time_t reference, calendarfn cb, void *closure) dt_end.tm_mon = ref.tm_mon; dt_end.tm_year = ref.tm_year; + + if (ref.tm_isdst > dt_start.tm_isdst){ + dt_start.tm_hour--; + dt_end.tm_hour--; + } else if (ref.tm_isdst < dt_start.tm_isdst){ + dt_start.tm_hour++; + dt_end.tm_hour++; + } + s_t = mktime (&dt_start); + if (ico->exdate && is_date_in_list (ico->exdate, &dt_start)) return 1; e_t = mktime (&dt_end); - + if ((s_t == -1) || (e_t == -1)) { g_warning ("Produced invalid dates!\n"); return 0; @@ -1131,9 +1141,10 @@ ical_object_generate_events (iCalObject *ico, time_t start, time_t end, calendar if (time_in_range (current, start, end) && recur_in_range (current, ico->recur)) { /* Weekdays to recur on are specified as a bitmask */ - if (ico->recur->weekday & (1 << tm->tm_wday)) + if (ico->recur->weekday & (1 << tm->tm_wday)) { if (!generate (ico, current, cb, closure)) return; + } } /* Advance by day for scanning the week or by interval at week end */ |