Merge lp:~nik90/ubuntu-clock-app/correct-time-locale into lp:ubuntu-clock-app
Status: | Merged |
---|---|
Merged at revision: | 12 |
Proposed branch: | lp:~nik90/ubuntu-clock-app/correct-time-locale |
Merge into: | lp:ubuntu-clock-app |
Diff against target: |
107 lines (+42/-37) 1 file modified
app/clock/Clock.qml (+42/-37) |
To merge this branch: | bzr merge lp:~nik90/ubuntu-clock-app/correct-time-locale |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Needs Fixing | |
Victor Thompson | Approve | ||
David Planella | Pending | ||
Ubuntu Clock Developers | Pending | ||
Review via email: mp+225005@code.launchpad.net |
Commit message
Returns the clock time in the proper user locale.
Description of the change
Returns the clock time in the proper user locale.
By using Qt.formatTime(new Date()), we allow Qt to return the time in locale set by the user. So the clock app does not control whether it is returned in 12-hour or 24-hour, but rather the locale dictates that.
However the designers stated that they want the time to be centered in bold text while the "am/pm" text should be shown beneath it if the locale uses the 12-hour format. I used Qt.locale().pmText and Qt.locale().amText to detect if there are "am/pm" strings in the clock time and if they are present then format the time accordingly to show it as defined by the designers.
All this is done without affecting the locale set by the user.
@victor, one reason why we do is that during my discussing with david, he informed me that time in certain locales are shown as hh.mm in which cases using ":" to split the string will fail. As a result, I resorted to showing the time including the separator in one color and then showing the "am/pm" text below using the qt locale variable.
FAILED: Continuous integration, rev:12 /code.launchpad .net/~nik90/ ubuntu- clock-app/ correct- time-locale/ +merge/ 225005/ +edit-commit- message
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http:// 91.189. 93.70:8080/ job/ubuntu- clock-dev- ubuntu- clock-app- utopic- 3.0-ci/ 5/ 91.189. 93.70:8080/ job/generic- mediumtests- utopic/ 724/console 91.189. 93.70:8080/ job/ubuntu- clock-dev- ubuntu- clock-app- utopic- 3.0-utopic- amd64-ci/ 5/console
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: 91.189. 93.70:8080/ job/ubuntu- clock-dev- ubuntu- clock-app- utopic- 3.0-ci/ 5/rebuild
http://