[gnome-calendar/gnome-3-20] time-selector: fix AM to PM time logic



commit 8f759e2d82760b7404ed89a5c0c32118df2307bf
Author: Ernestas Kulik <ernestas kulik gmail com>
Date:   Wed Jul 27 22:24:36 2016 +0300

    time-selector: fix AM to PM time logic
    
    Currently, the hour component of the time is doubled when switching from
    AM to PM, which is incorrect. This commit fixes the logic by adding 12
    hours when switching to PM.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=765370

 src/gcal-time-selector.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/gcal-time-selector.c b/src/gcal-time-selector.c
index c9711e8..a5d432f 100644
--- a/src/gcal-time-selector.c
+++ b/src/gcal-time-selector.c
@@ -106,7 +106,7 @@ update_time (GcalTimeSelector *selector)
       g_signal_handlers_block_by_func (selector->period_combo, update_time, selector);
 
       gtk_combo_box_set_active (GTK_COMBO_BOX (selector->period_combo), hour > 12);
-      hour *= 2;
+      hour += 12;
 
       g_signal_handlers_unblock_by_func (selector->period_combo, update_time, selector);
     }


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