fix(calendar): Fix Out of range value for column 'c_startdate' SQL error. Add log.

This commit is contained in:
smizrahi
2023-09-11 11:34:04 +02:00
parent a1528bcc03
commit 1a257c7768

View File

@@ -1149,10 +1149,12 @@ andAttribute: (EOAttribute *)_attribute
startDate = [theComponent startDate];
t = [startDate timeIntervalSince1970];
if (startDate) {
if (t < (long long)INT_MAX && t > (long long)INT_MIN)
if (t < (long long)INT_MAX && t > (long long)INT_MIN) {
[quickRow setObject:[NSNumber numberWithInt: t] forKey:@"c_startdate"];
else
} else {
[self errorWithFormat:@"Unexpected value. Invalid start date for timestamp %f", t];
[quickRow setObject:[NSNumber numberWithInt: 0] forKey:@"c_startdate"];
}
}
}