Trying very hard not to miss calendar events
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix timezone handling

Co-authored-by: Claude <noreply@anthropic.com>

+13 -1
+13 -1
crates/alarma-eds/src/ffi/mod.rs
··· 494 494 unsafe { bindings::i_cal_time_is_date(self.ptr) != 0 } 495 495 } 496 496 497 + /// Returns Unix timestamp (seconds since epoch) accounting for timezone. 498 + /// This properly converts the time to UTC before returning the timestamp. 497 499 pub fn as_timet(&self) -> i64 { 498 - unsafe { bindings::i_cal_time_as_timet(self.ptr) } 500 + unsafe { 501 + // Get the timezone associated with this time 502 + let tz = bindings::i_cal_time_get_timezone(self.ptr); 503 + if !tz.is_null() { 504 + // Use timezone-aware conversion 505 + bindings::i_cal_time_as_timet_with_zone(self.ptr, tz) 506 + } else { 507 + // No timezone info - interpret as UTC 508 + bindings::i_cal_time_as_timet(self.ptr) 509 + } 510 + } 499 511 } 500 512 } 501 513