diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2015-04-06 13:17:39 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2015-04-06 13:17:39 -0500 |
commit | 7e9b4645721cc76322198df3b55f4cdedc55c200 (patch) | |
tree | ae7321024bca7d545fe2a8d55ee0735d17d0c1a2 | |
parent | a3c896c8dd8c82b1d622a3a1220df0870f84d573 (diff) | |
download | ayatana-indicator-datetime-7e9b4645721cc76322198df3b55f4cdedc55c200.tar.gz ayatana-indicator-datetime-7e9b4645721cc76322198df3b55f4cdedc55c200.tar.bz2 ayatana-indicator-datetime-7e9b4645721cc76322198df3b55f4cdedc55c200.zip |
in new EDS code, use timezones consistently
-rw-r--r-- | src/engine-eds.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/engine-eds.cpp b/src/engine-eds.cpp index 2b62fd1..073b39d 100644 --- a/src/engine-eds.cpp +++ b/src/engine-eds.cpp @@ -497,11 +497,16 @@ private: auto status = ICAL_STATUS_NONE; e_cal_component_get_status(component, &status); - const auto begin_dt = DateTime(begin); - const auto end_dt = DateTime(end); + // get the timezone we want to use for generated Appointments/Alarms + const char * location = icaltimezone_get_location(subtask->default_timezone); + auto gtz = g_time_zone_new(location); + g_debug("timezone abbreviation is %s", g_time_zone_get_abbreviation (gtz, 0)); + + const DateTime begin_dt { gtz, begin }; + const DateTime end_dt { gtz, end }; g_debug ("got appointment from %s to %s, uid %s status %d", - begin_dt.format("%F %T").c_str(), - end_dt.format("%F %T").c_str(), + begin_dt.format("%F %T %z").c_str(), + end_dt.format("%F %T %z").c_str(), uid, (int)status); @@ -560,7 +565,7 @@ private: if (a != nullptr) { - const DateTime alarm_begin{ai->trigger}; + const DateTime alarm_begin{gtz, ai->trigger}; auto& alarm = alarms[alarm_begin]; if (alarm.text.empty()) @@ -608,6 +613,8 @@ private: subtask->task->appointments.push_back(appointment); } + + g_time_zone_unref(gtz); } return G_SOURCE_CONTINUE; |