Already fetch the start date and reminder state for issues immediately and have them available in the struct Task.
11 lines
385 B
Rust
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()
|
|
}
|