[gnome-calendar] month-view: fix end-of-month multi-day selections
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] month-view: fix end-of-month multi-day selections
- Date: Mon, 14 Mar 2016 19:55:46 +0000 (UTC)
commit 96d2b37fec5c32709a5d0d6a3d2bd83ecf5d366e
Author: fosero <fosero users noreply github com>
Date: Sun Mar 6 14:03:20 2016 +0100
month-view: fix end-of-month multi-day selections
Use g_date_time_add_days to add a day to the final day of the month to
fix behaviour when selecting a range up to the last day of the month.
https://bugzilla.gnome.org/show_bug.cgi?id=763015
src/gcal-month-view.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/gcal-month-view.c b/src/gcal-month-view.c
index 6574f6e..0d91d9c 100644
--- a/src/gcal-month-view.c
+++ b/src/gcal-month-view.c
@@ -282,7 +282,14 @@ show_popover_for_position (GcalMonthView *view,
/* Only setup an end date when days are different */
if (start_day != end_day)
- end_dt = g_date_time_new_local (priv->date->year, priv->date->month, end_day + 1, 0, 0, 0);
+ {
+ GDateTime *tmp_dt;
+
+ tmp_dt = g_date_time_new_local (priv->date->year, priv->date->month, end_day, 0, 0, 0);
+ end_dt = g_date_time_add_days (tmp_dt, 1);
+
+ g_clear_pointer (&tmp_dt, g_date_time_unref);
+ }
g_signal_emit_by_name (GCAL_VIEW (widget), "create-event", start_dt, end_dt, x, y);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]