Unify display of event times in vCalendar's mimeviewer on Windows and Unix.
authorAndrej Kacian <ticho@claws-mail.org>
Sat, 4 Feb 2017 16:35:20 +0000 (17:35 +0100)
committerAndrej Kacian <ticho@claws-mail.org>
Sat, 4 Feb 2017 16:35:20 +0000 (17:35 +0100)
We now use g_date_time_format() on both. Also, display
timezone abbreviation (%Z) instead of offset (%z) in the
strings.

src/plugins/vcalendar/vcal_manager.c

index c303b9b..a05ca36 100644 (file)
@@ -790,28 +790,16 @@ VCalEvent * vcal_manager_new_event        (const gchar    *uid,
 
        if (dtend && *(dtend)) {
                time_t tmp = icaltime_as_timet((icaltime_from_string(dtend)));
-#ifdef G_OS_WIN32
                GDateTime *dt = g_date_time_new_from_unix_local(tmp);
-               event->end = g_date_time_format(dt, "%a, %e %b %Y %H:%M:%S %z");
+               event->end = g_date_time_format(dt, "%a, %e %b %Y %H:%M:%S %Z");
                g_date_time_unref(dt);
-#else
-               gchar buft[512];
-               tzset();
-               event->end      = g_strdup(ctime_r(&tmp, buft));
-#endif
        }
        
        if (dtstart && *(dtstart)) {
                time_t tmp = icaltime_as_timet((icaltime_from_string(dtstart)));
-#ifdef G_OS_WIN32
                GDateTime *dt = g_date_time_new_from_unix_local(tmp);
-               event->start = g_date_time_format(dt, "%a, %e %b %Y %H:%M:%S %z");
+               event->start = g_date_time_format(dt, "%a, %e %b %Y %H:%M:%S %Z");
                g_date_time_unref(dt);
-#else
-               gchar buft[512];
-               tzset();
-               event->start    = g_strdup(ctime_r(&tmp, buft));
-#endif
        }
        event->dtstart          = g_strdup(dtstart?dtstart:"");
        event->dtend            = g_strdup(dtend?dtend:"");