[gnome-calendar/gbsneto/timezone-fixes: 2/3] event-popover: Display times in local timezone




commit 076d0e6102dc6d9e3518a1ed1397c6909959ba68
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Tue Dec 7 12:29:31 2021 -0300

    event-popover: Display times in local timezone
    
    Convert the start and end datetimes to the local timezone
    before displaying them.

 src/gui/gcal-event-popover.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/gui/gcal-event-popover.c b/src/gui/gcal-event-popover.c
index 94cfabcf..4d6aee8c 100644
--- a/src/gui/gcal-event-popover.c
+++ b/src/gui/gcal-event-popover.c
@@ -352,9 +352,9 @@ format_single_day (GcalEventPopover *self,
 static void
 update_date_time_label (GcalEventPopover *self)
 {
+  g_autoptr (GDateTime) start_dt = NULL;
+  g_autoptr (GDateTime) end_dt = NULL;
   g_autoptr (GString) string = NULL;
-  GDateTime *end_dt;
-  GDateTime *start_dt;
   gboolean show_hours;
   gboolean multiday;
   gboolean all_day;
@@ -364,8 +364,8 @@ update_date_time_label (GcalEventPopover *self)
   multiday = gcal_event_is_multiday (self->event);
   show_hours = !all_day;
 
-  end_dt = gcal_event_get_date_end (self->event);
-  start_dt = gcal_event_get_date_start (self->event);
+  end_dt = g_date_time_to_local (gcal_event_get_date_end (self->event));
+  start_dt = g_date_time_to_local (gcal_event_get_date_start (self->event));
 
   if (multiday)
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]