TaskBot/src/util.rs
Rahix 64d28bb868 Collect start date and reminder state
Already fetch the start date and reminder state for issues immediately
and have them available in the struct Task.
2026-03-05 20:42:25 +01:00

11 lines
385 B
Rust

pub fn time_to_jiff(t: time::OffsetDateTime) -> jiff::Zoned {
let tz = jiff::tz::TimeZone::fixed(jiff::tz::offset(t.offset().whole_hours()));
jiff::Timestamp::new(t.unix_timestamp(), 0)
.unwrap()
.to_zoned(tz)
}
pub fn jiff_to_time(t: &jiff::Zoned) -> time::OffsetDateTime {
time::OffsetDateTime::from_unix_timestamp(t.timestamp().as_second()).unwrap()
}