mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-16 06:18:47 +02:00
Never return a year < 1990 from trigger()
This commit is contained 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()
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user