diff options
author | Nora <nora.widdecke@tu-bs.de> | 2019-01-19 23:29:45 +0100 |
---|---|---|
committer | Nora <nora.widdecke@tu-bs.de> | 2019-01-19 23:29:45 +0100 |
commit | f327d4b66acc9f0aae9c4f43bd9238f9da06a0ef (patch) | |
tree | 0a2902ce844fbc04e0312c1864c32476820f0704 /src/icalwrap | |
parent | 6e0e894556430f3dc24e8da5cb498e323dd910dd (diff) |
use icaltime in with_lat_modified_now
Diffstat (limited to 'src/icalwrap')
-rw-r--r-- | src/icalwrap/icalvcalendar.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/icalwrap/icalvcalendar.rs b/src/icalwrap/icalvcalendar.rs index fdb1c1d..fdbdb0f 100644 --- a/src/icalwrap/icalvcalendar.rs +++ b/src/icalwrap/icalvcalendar.rs @@ -141,13 +141,11 @@ impl IcalVCalendar { pub fn with_last_modified_now(self) -> Self { let event = self.get_principal_event(); unsafe { - let now = dateutil::now().timestamp(); - let is_date = 0; // 1 == true - let now_icaltime = ical::icaltime_from_timet_with_zone(now, is_date, ical::icaltimezone_get_utc_timezone()); + let now_icaltime = IcalTime::now(); if let Some(prop) = event.get_property_by_name("LAST-MODIFIED") { - ical::icalproperty_set_lastmodified(prop.ptr, now_icaltime); + ical::icalproperty_set_lastmodified(prop.ptr, *now_icaltime); } else { - let prop_lastmod = ical::icalproperty_new_lastmodified(now_icaltime); + let prop_lastmod = ical::icalproperty_new_lastmodified(*now_icaltime); ical::icalcomponent_add_property(event.get_ptr(), prop_lastmod); } } |