daylight saving time related problems fixed (thanks youshe and Jan for reporting them)
This commit is contained in:
parent
53db22a380
commit
f06c1b142f
@ -1,3 +1,9 @@
|
|||||||
|
2008-12-13 Frederic Culot <frederic@culot.org>
|
||||||
|
|
||||||
|
* src/recur.c (recur_item_inday)
|
||||||
|
* src/utils.c (date_sec_change): daylight saving time unwanted
|
||||||
|
offset fixed (thanks youshe and Jan for reporting the problem)
|
||||||
|
|
||||||
2008-12-12 Frederic Culot <frederic@culot.org>
|
2008-12-12 Frederic Culot <frederic@culot.org>
|
||||||
|
|
||||||
* src/utils.c (mycpy): suppressed and replaced by strdup
|
* src/utils.c (mycpy): suppressed and replaced by strdup
|
||||||
|
11
src/recur.c
11
src/recur.c
@ -1,4 +1,4 @@
|
|||||||
/* $calcurse: recur.c,v 1.42 2008/12/12 20:44:50 culot Exp $ */
|
/* $calcurse: recur.c,v 1.43 2008/12/13 21:41:25 culot Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Calcurse - text-based organizer
|
* Calcurse - text-based organizer
|
||||||
@ -425,6 +425,7 @@ recur_day_is_exc (long day, struct days_s *item_exc)
|
|||||||
* Check if the recurrent item belongs to the selected day,
|
* Check if the recurrent item belongs to the selected day,
|
||||||
* and if yes, return the real start time.
|
* and if yes, return the real start time.
|
||||||
* This function was improved thanks to Tony's patch.
|
* This function was improved thanks to Tony's patch.
|
||||||
|
* Thanks also to youshe for reporting daylight saving time related problems.
|
||||||
*/
|
*/
|
||||||
unsigned
|
unsigned
|
||||||
recur_item_inday (long item_start, struct days_s *item_exc, int rpt_type,
|
recur_item_inday (long item_start, struct days_s *item_exc, int rpt_type,
|
||||||
@ -454,15 +455,11 @@ recur_item_inday (long item_start, struct days_s *item_exc, int rpt_type,
|
|||||||
t = item_start;
|
t = item_start;
|
||||||
lt_item = *localtime (&t);
|
lt_item = *localtime (&t);
|
||||||
|
|
||||||
/* For proper calculation, both items must start at same time. */
|
|
||||||
day_start += (lt_item.tm_hour * HOURINSEC + lt_item.tm_min * MININSEC +
|
|
||||||
lt_item.tm_sec);
|
|
||||||
|
|
||||||
switch (rpt_type)
|
switch (rpt_type)
|
||||||
{
|
{
|
||||||
case RECUR_DAILY:
|
case RECUR_DAILY:
|
||||||
diff = (long) difftime ((time_t) day_start, (time_t) item_start);
|
diff = lt_day.tm_yday - lt_item.tm_yday;
|
||||||
if (diff % (rpt_freq * DAYINSEC) != 0)
|
if (diff % rpt_freq != 0)
|
||||||
return (0);
|
return (0);
|
||||||
lt_item.tm_mday = lt_day.tm_mday;
|
lt_item.tm_mday = lt_day.tm_mday;
|
||||||
lt_item.tm_mon = lt_day.tm_mon;
|
lt_item.tm_mon = lt_day.tm_mon;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $calcurse: utils.c,v 1.57 2008/12/12 20:44:50 culot Exp $ */
|
/* $calcurse: utils.c,v 1.58 2008/12/13 21:41:25 culot Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Calcurse - text-based organizer
|
* Calcurse - text-based organizer
|
||||||
@ -561,6 +561,7 @@ date_sec_change (long date, int delta_month, int delta_day)
|
|||||||
lt = localtime (&t);
|
lt = localtime (&t);
|
||||||
lt->tm_mon += delta_month;
|
lt->tm_mon += delta_month;
|
||||||
lt->tm_mday += delta_day;
|
lt->tm_mday += delta_day;
|
||||||
|
lt->tm_isdst = -1;
|
||||||
t = mktime (lt);
|
t = mktime (lt);
|
||||||
if (t == -1)
|
if (t == -1)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user