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

This commit is contained in:
smizrahi
2023-05-15 20:17:55 +02:00
parent 158a5becc9
commit 32a04998e5

View File

@@ -1145,9 +1145,14 @@ andAttribute: (EOAttribute *)_attribute
{
// Update c_startdate for appointments
if ([theComponent respondsToSelector:@selector(startDate)]) {
NSTimeInterval t = [startDate timeIntervalSince1970];
startDate = [theComponent startDate];
if (startDate) {
[quickRow setObject:[NSNumber numberWithInt:[startDate timeIntervalSince1970]] forKey:@"c_startdate"];
if (t < (long long)INT_MAX && t > (long long)INT_MIN)
[quickRow setObject:[NSNumber numberWithInt: t] forKey:@"c_startdate"];
else
[quickRow setObject:[NSNumber numberWithInt: 0] forKey:@"c_startdate"];
}
}