diff options
author | Vincent Breitmoser <look@my.amazin.horse> | 2019-01-12 15:38:57 +0100 |
---|---|---|
committer | Vincent Breitmoser <look@my.amazin.horse> | 2019-01-12 16:33:39 +0100 |
commit | c61a8075a98c4674694f3ab25f15cca54f9958f8 (patch) | |
tree | 7ddb912ebc4460f25f130e9824181c5121734ad0 /src/icalwrap/icalvevent.rs | |
parent | 5216a30ac92716aa16b8760bd9048820a7466f33 (diff) |
use Local for instance timestamps instead of Utc
Diffstat (limited to 'src/icalwrap/icalvevent.rs')
-rw-r--r-- | src/icalwrap/icalvevent.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/icalwrap/icalvevent.rs b/src/icalwrap/icalvevent.rs index d51003f..278d737 100644 --- a/src/icalwrap/icalvevent.rs +++ b/src/icalwrap/icalvevent.rs @@ -8,7 +8,7 @@ use ical; pub struct IcalVEvent { ptr: *mut ical::icalcomponent, parent: Option<IcalVCalendar>, - instance_timestamp: Option<DateTime<Utc>>, + instance_timestamp: Option<DateTime<Local>>, } impl Drop for IcalVEvent { @@ -123,7 +123,7 @@ impl IcalVEvent { result } - pub fn with_internal_timestamp(&self, datetime: DateTime<Utc>) -> IcalVEvent { + pub fn with_internal_timestamp(&self, datetime: DateTime<Local>) -> IcalVEvent { IcalVEvent { ptr: self.ptr, parent: self.parent.as_ref().map(|parent| parent.shallow_copy()), @@ -132,7 +132,9 @@ impl IcalVEvent { } pub fn get_recur_instances(&self) -> impl Iterator<Item = IcalVEvent> + '_ { - self.get_recur_datetimes().into_iter().map(move |rec| self.with_internal_timestamp(rec)) + self.get_recur_datetimes().into_iter() + .map(|recur_utc| recur_utc.with_timezone(&Local)) + .map(move |recur_local| self.with_internal_timestamp(recur_local)) } pub fn get_parent(&self) -> Option<&IcalVCalendar> { |