[gnome-calendar/gnome-3-32] edit-dialog: Don't convert date to timezone if all-day
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar/gnome-3-32] edit-dialog: Don't convert date to timezone if all-day
- Date: Fri, 10 May 2019 15:08:54 +0000 (UTC)
commit 787b638b4a06053cb7d0f5496342dcd3aa6b955b
Author: Florian Latifi <mail florian-latifi at>
Date: Wed Feb 6 02:33:02 2019 +0100
edit-dialog: Don't convert date to timezone if all-day
When the all-day checkbox is ticked, transforming to the
UTC timezone may change the dates of the event. On positive
timezone offsets, this happens frequently.
Fix that by only transforming to a timezone when the event
is not marked as all-day.
Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/issues/338
src/gcal-edit-dialog.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/gcal-edit-dialog.c b/src/gcal-edit-dialog.c
index 051816fd..da0f9ad2 100644
--- a/src/gcal-edit-dialog.c
+++ b/src/gcal-edit-dialog.c
@@ -316,14 +316,17 @@ return_datetime_for_widgets (GcalEditDialog *self,
all_day ? 0 : g_date_time_get_minute (time),
0);
- date_in_best_tz = g_date_time_to_timezone (date_in_local_tz, timezone);
+ if (all_day)
+ date_in_best_tz = g_date_time_ref (date_in_local_tz);
+ else
+ date_in_best_tz = g_date_time_to_timezone (date_in_local_tz, timezone);
retval = g_date_time_new (timezone,
g_date_time_get_year (date_in_best_tz),
g_date_time_get_month (date_in_best_tz),
g_date_time_get_day_of_month (date_in_best_tz),
- all_day ? 0 : g_date_time_get_hour (date_in_best_tz),
- all_day ? 0 : g_date_time_get_minute (date_in_best_tz),
+ g_date_time_get_hour (date_in_best_tz),
+ g_date_time_get_minute (date_in_best_tz),
0);
return retval;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]