More timezone fixification.

This commit is contained in:
Dianne Skoll
2025-09-03 13:05:54 -04:00
parent 272336226e
commit 5f9e71f9eb
2 changed files with 28 additions and 1 deletions

View File

@@ -4216,6 +4216,10 @@ FEvalTrig(func_info *info)
DestroyParser(&p);
return r;
}
if (trig.tz != NULL && tim.ttime == NO_TIME) {
FreeTrig(&trig);
return E_TZ_NO_AT;
}
if (trig.typ != NO_TYPE) {
DestroyParser(&p);
FreeTrig(&trig);
@@ -4238,7 +4242,6 @@ FEvalTrig(func_info *info)
r = 0;
dse = -1;
}
FreeTrig(&trig);
DestroyParser(&p);
if (r) return r;
if (dse < 0) {
@@ -4252,6 +4255,7 @@ FEvalTrig(func_info *info)
RetVal.type = DATETIME_TYPE;
RETVAL = (MINUTES_PER_DAY * dse) + tim.ttime;
}
FreeTrig(&trig);
return OK;
}
@@ -4280,6 +4284,10 @@ FMultiTrig(func_info *info)
DestroyParser(&p);
return r;
}
if (trig.tz != NULL && tim.ttime == NO_TIME) {
FreeTrig(&trig);
return E_TZ_NO_AT;
}
if (trig.typ != NO_TYPE) {
DestroyParser(&p);
FreeTrig(&trig);
@@ -4341,6 +4349,10 @@ FTrig(func_info *info)
DestroyParser(&p);
return r;
}
if (trig.tz != NULL && tim.ttime == NO_TIME) {
FreeTrig(&trig);
return E_TZ_NO_AT;
}
if (trig.typ != NO_TYPE) {
DestroyParser(&p);
FreeTrig(&trig);

View File

@@ -613,6 +613,21 @@ int ComputeTriggerNoAdjustDuration(int today, Trigger *trig, TimeTrig const *tim
omit = 0;
}
/** FIXME: If a timed reminder moves to yesterday because of a time
zone adjustment, try again! */
if (trig->tz) {
TimeTrig copy = *tim;
int new_result;
ExitTimezone(trig->tz);
new_result = AdjustTriggerForTimeZone(trig, result, &copy);
EnterTimezone(trig->tz);
if (new_result + duration_days < today) {
nextstart = start+1;
start = nextstart;
continue;
}
}
/** FIXME: Fix bad interaction with SATISFY... need to rethink!!! */
if (result+duration_days >= today &&
(trig->skip != SKIP_SKIP || !omit)) {