[gnome-calendar/gbsneto/timezone-fixes: 1/2] event-popover: Display times in local timezone
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar/gbsneto/timezone-fixes: 1/2] event-popover: Display times in local timezone
- Date: Tue, 7 Dec 2021 16:32:25 +0000 (UTC)
commit fc3ad22169aeb47dc951ddc60718b766bfa44151
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 | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/src/gui/gcal-event-popover.c b/src/gui/gcal-event-popover.c
index 94cfabcf..2403f725 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,16 @@ 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);
+ if (all_day)
+ {
+ start_dt = g_date_time_ref (gcal_event_get_date_start (self->event));
+ end_dt = g_date_time_ref (gcal_event_get_date_end (self->event));
+ }
+ else
+ {
+ start_dt = g_date_time_to_local (gcal_event_get_date_start (self->event));
+ end_dt = g_date_time_to_local (gcal_event_get_date_end (self->event));
+ }
if (multiday)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]