← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~vthompson/ubuntu-weather-app/reboot-time-of-day into lp:ubuntu-weather-app/reboot

 

Victor Thompson has proposed merging lp:~vthompson/ubuntu-weather-app/reboot-time-of-day into lp:ubuntu-weather-app/reboot.

Commit message:
Show am/pm text depending upon locale

Requested reviews:
  Ubuntu Weather Developers (ubuntu-weather-dev)

For more details, see:
https://code.launchpad.net/~vthompson/ubuntu-weather-app/reboot-time-of-day/+merge/261921

Show am/pm text depending upon locale
-- 
Your team Ubuntu Weather Developers is requested to review the proposed merge of lp:~vthompson/ubuntu-weather-app/reboot-time-of-day into lp:ubuntu-weather-app/reboot.
=== modified file 'app/components/HomeHourly.qml'
--- app/components/HomeHourly.qml	2015-04-09 22:28:40 +0000
+++ app/components/HomeHourly.qml	2015-06-15 00:30:43 +0000
@@ -28,6 +28,8 @@
     model: forecasts.length
     orientation: ListView.Horizontal
 
+    property string currentDate: Qt.formatTime(new Date())
+
     onVisibleChanged: {
         if(visible) {
             ListView.model = forecasts.length
@@ -60,7 +62,7 @@
                 anchors.horizontalCenter: parent.horizontalCenter
                 fontSize: "small"
                 font.weight: Font.Light
-                text: formatTimestamp(hourData.date, 'ddd')+" "+formatTime(hourData.date, 'h:mm')
+                text: currentDate.search(Qt.locale().amText) !== -1 || currentDate.search(Qt.locale().pmText) !== -1 ? formatTimestamp(hourData.date, 'ddd')+" "+formatTime(hourData.date, 'hap') : formatTimestamp(hourData.date, 'ddd')+" "+formatTime(hourData.date, 'h:mm')
             }
 
             Item {


Follow ups