← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~gang65/ubuntu-clock-app/ubuntu-clock-wrong-times-fix into lp:ubuntu-clock-app

 

Bartosz Kosiorek has proposed merging lp:~gang65/ubuntu-clock-app/ubuntu-clock-wrong-times-fix into lp:ubuntu-clock-app.

Commit message:
Fox clock issues after changing timezone, when Clock application is running (LP: #1480546)

Requested reviews:
  Ubuntu Clock Developers (ubuntu-clock-dev)
Related bugs:
  Bug #1480546 in Ubuntu Clock App: "Alarms get set at wrong times after travelling"
  https://bugs.launchpad.net/ubuntu-clock-app/+bug/1480546

For more details, see:
https://code.launchpad.net/~gang65/ubuntu-clock-app/ubuntu-clock-wrong-times-fix/+merge/269759

Fox clock issues after changing timezone, when Clock application is running (LP: #1480546)
-- 
Your team Ubuntu Clock Developers is requested to review the proposed merge of lp:~gang65/ubuntu-clock-app/ubuntu-clock-wrong-times-fix into lp:ubuntu-clock-app.
=== modified file 'app/alarm/AlarmDelegate.qml'
--- app/alarm/AlarmDelegate.qml	2015-08-17 18:28:28 +0000
+++ app/alarm/AlarmDelegate.qml	2015-09-01 14:11:50 +0000
@@ -56,7 +56,7 @@
 
             color: UbuntuColors.midAubergine
             fontSize: "x-large"
-            text: Qt.formatTime(date)
+            text: Qt.formatTime(date, Qt.SystemLocaleShortDate)
         }
 
         RowLayout {

=== modified file 'app/alarm/EditAlarmPage.qml'
--- app/alarm/EditAlarmPage.qml	2015-08-26 23:35:50 +0000
+++ app/alarm/EditAlarmPage.qml	2015-09-01 14:11:50 +0000
@@ -211,7 +211,17 @@
         }
 
         onDateChanged: {
-            _timePicker.date = _alarm.date
+            _timePicker.date = new Date
+                    (
+                         _alarm.date.getFullYear(),
+                         _alarm.date.getMonth(),
+                         _alarm.date.getDate(),
+                         _alarm.date.toLocaleTimeString().split(":")[0],
+                         _alarm.date.toLocaleTimeString().split(":")[1],
+                        0,
+                        0
+                        )
+
         }
     }
 

=== modified file 'app/components/Clock.qml'
--- app/components/Clock.qml	2015-08-14 05:34:49 +0000
+++ app/components/Clock.qml	2015-09-01 14:11:50 +0000
@@ -44,8 +44,9 @@
     // Property to set the analog time
     property var analogTime
 
-    // Property to set the digital time label
-    property string time: Qt.formatTime(analogTime)
+    // Property to set the digital time label.
+    // Use system time, to change time automatically when it will be changed in system
+    property string time: Qt.formatTime(analogTime, Qt.SystemLocaleShortDate)
 
     // Property to keep track of the clock mode
     property alias isDigital: clockModeFlipable.isDigital

=== modified file 'app/components/DigitalMode.qml'
--- app/components/DigitalMode.qml	2015-08-14 05:34:49 +0000
+++ app/components/DigitalMode.qml	2015-09-01 14:11:50 +0000
@@ -55,20 +55,7 @@
 
         color: UbuntuColors.midAubergine
         font.pixelSize: units.dp(1)
-        text: {
-            if (time.search(Qt.locale().amText) !== -1) {
-                // 12 hour format detected with the localised AM text
-                return time.replace(Qt.locale().amText, "").trim()
-            }
-            else if (time.search(Qt.locale().pmText) !== -1) {
-                // 12 hour format detected with the localised PM text
-                return time.replace(Qt.locale().pmText, "").trim()
-            }
-            else {
-                // 24-hour format detected, return full time string
-                return time
-            }
-        }
+        text: analogTime.getHours() + ":" + analogTime.getMinutes()
     }
 
     Label {


Follow ups