mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-17 23:08:40 +02:00
Support DATETIME - TIME
This commit is contained in:
@@ -1761,9 +1761,11 @@ the original \fBDATE\fR.
|
|||||||
earlier
|
earlier
|
||||||
than the original \fBTIME\fR.
|
than the original \fBTIME\fR.
|
||||||
.PP
|
.PP
|
||||||
\fBDATETIME\fR - \fBINT\fR - returns a \fBDATETIME\fR that is \fBINT\fR minutes
|
\fBDATETIME\fR - \fBINT\fR - returns a \fBDATETIME\fR that is
|
||||||
earlier
|
\fBINT\fR minutes earlier than the original \fBDATETIME\fR.
|
||||||
than the original \fBDATETIME\fR.
|
.PP
|
||||||
|
\fBDATETIME\fR - \fBTIME\fR - coerces the \fBTIME\fR to an \fBINT\fR
|
||||||
|
and then performs subtraction as above.
|
||||||
.RE
|
.RE
|
||||||
.TP
|
.TP
|
||||||
.B <, <=, >, and >=
|
.B <, <=, >, and >=
|
||||||
|
|||||||
@@ -854,8 +854,9 @@ static int Subtract(void)
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If it's a datetime minus an int, do subtraction, checking for underflow */
|
/* If it's a datetime minus an int or a time, do subtraction,
|
||||||
if (v1.type == DATETIME_TYPE && v2.type == INT_TYPE) {
|
* checking for underflow */
|
||||||
|
if (v1.type == DATETIME_TYPE && (v2.type == INT_TYPE || v2.type == TIME_TYPE)) {
|
||||||
v1.v.val -= v2.v.val;
|
v1.v.val -= v2.v.val;
|
||||||
if (v1.v.val < 0) return E_DATE_OVER;
|
if (v1.v.val < 0) return E_DATE_OVER;
|
||||||
PushValStack(v1);
|
PushValStack(v1);
|
||||||
|
|||||||
Reference in New Issue
Block a user