diff --git a/man/remind.1.in b/man/remind.1.in index f14bee78..1f9ffcbb 100644 --- a/man/remind.1.in +++ b/man/remind.1.in @@ -4837,6 +4837,11 @@ Finally: .PP returns "30 November 1994 AT 22:00" for EST, which is 5 hours behind UTC. The value for your time zone may differ. +.PP +\fBtrigger()\fR will \fInever\fR return a date earlier than "1 January 1990" +even if the UTC flag dictates that it should. So do not use it for reminders +before about 2 January 1990 in your local time zone. I do not anticipate this +restriction being a real problem. .RE .TP .B trigtags() diff --git a/src/funcs.c b/src/funcs.c index 71ed69fc..70c28593 100644 --- a/src/funcs.c +++ b/src/funcs.c @@ -2179,6 +2179,9 @@ static int FTrigger(func_info *info) tim = ARGV(1); if (ARGV(2)) { UTCToLocal(date, tim, &date, &tim); + if (date < 0) { + date = 0; + } } } else if (Nargs > 1) { /* Date Time */ @@ -2193,6 +2196,9 @@ static int FTrigger(func_info *info) ASSERT_TYPE(1, INT_TYPE); if (ARGV(1)) { UTCToLocal(date, tim, &date, &tim); + if (date < 0) { + date = 0; + } } } } diff --git a/tests/test.cmp b/tests/test.cmp index c1f1b1b2..63ab87c9 100644 --- a/tests/test.cmp +++ b/tests/test.cmp @@ -39472,6 +39472,7 @@ utctolocal(2051-01-01@04:44) => 2050-12-31@23:44 utctolocal(2050-03-13@05:00) => 2050-03-13@00:00 utctolocal(2050-11-06@04:00) => 2050-11-06@00:00 utctolocal(2050-11-06@07:00) => 2050-11-06@02:00 +trigger(1990-01-01@01:22, 1) => "1 January 1990 AT 20:22" No reminders. -stdin-(9): `x' re-SET without being used (previous SET: -stdin-:8) -stdin-(11): `y' UNSET without being used (previous SET: -stdin-:10) diff --git a/tests/yearfold.rem b/tests/yearfold.rem index a0b516e3..95e84757 100644 --- a/tests/yearfold.rem +++ b/tests/yearfold.rem @@ -34,3 +34,5 @@ set a utctolocal('2051-01-01@04:44') set a utctolocal('2050-03-13@05:00') set a utctolocal('2050-11-06@04:00') set a utctolocal('2050-11-06@07:00') + +set a trigger('1990-01-01@1:22', 1)