Closed
Bug 1035757
Opened 10 years ago
Closed 10 years ago
[B2G][Clock] support 24 hour time format
Categories
(Firefox OS Graveyard :: Gaia::Clock, defect)
Tracking
(feature-b2g:2.1)
People
(Reporter: howie, Assigned: mcav)
References
Details
Attachments
(1 file)
There will be a setting toggle to let user choose between 12/24 hour time format in v2.1. User story and settings spec: Bug 903683
For each app, the tasks to do after toggle is added would be:
1.Read/listen to the time format toggle value/change event.
2.Input the corresponding time format to existing mozL10n.DateTimeFormat() function. Currently the input time format should be a fixed 12 hour
shortTimeFormat = %I:%M %p , line 201 of http://goo.gl/DR4CNe. There will be a 24 hour time format added.
3.Show the return of the function as it's doing now.
Updated•10 years ago
|
QA Whiteboard: [COM=Productivity]
Updated•10 years ago
|
QA Whiteboard: [COM=Productivity] → [COM=Gaia::Clock]
Updated•10 years ago
|
Target Milestone: --- → 2.1 S3 (29aug)
Comment 1•10 years ago
|
||
Test steps:
1. Open settings app
2. change the Time format settings in Settings > Date & Time > Time Format panel
Expect:
The time format in clock app will be changed.
here's the patch steps to apply correct time format:
1. include navigator.mozHour12 API shim in gaia app's html
```
<script defer src="shared/js/date_time_helper.js"></script>
```
(currently we still need at least `settings: readonly` permission in manifest, which might changed in next release)
2. detect proper time format via mozHour12 API, and get correct time format string from new 'shortTimeFormat12'/'shortTimeFormat24'.
```
var timeFormat = window.navigator.mozHour12 ? _('shortTimeFormat12') : _('shortTimeFormat24');
```
3. call mozL10n DateTimeFormat to localize it
4. listen to 'timeformatchange' event and localize time strings when its triggered
The full usage is at [3](WIP) for reference.
[3] https://github.com/mozilla-b2g/gaia/pull/22757/files
Updated•10 years ago
|
Assignee: nobody → m
Assignee | ||
Comment 2•10 years ago
|
||
Working on this today; should have a patch up shortly.
Status: NEW → ASSIGNED
Assignee | ||
Comment 3•10 years ago
|
||
This patch adds subscriptions to "timeformatchange" (and refreshes the display) for the following three locations, which are the only places affected by this change:
- The alarm list (on the main clock screen)
- The alarm edit view (the time dropdown selector)
- The digital clock (tap on the analog clock to show)
I verified the changes via on-device testing; all locations update immediately as required. I attempted to automate this with a proper marionette test, however I wasn't able to get my changes to "navigator.mozHour12" to propagate through Marionette correctly; given the low risk of this patch and the proximity to feature landing, I'd like to open a followup to add automated testing if that's acceptable to :millermedeiros. (Unless you have any ideas as to why setting "navigator.mozHour12" in an executeScript block wouldn't take effect... i.e. is it some weird non-app-window navigator context?)
Attachment #8478572 -
Flags: review?(mmedeiros)
Comment 4•10 years ago
|
||
Comment on attachment 8478572 [details] [review]
Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/23283
LGTM!
Attachment #8478572 -
Flags: review?(mmedeiros) → review+
Comment 5•10 years ago
|
||
for marionette tests, check https://github.com/mozilla-b2g/gaia/pull/23063/files#diff-70645fc69e4165112da14ecb489b7bd9R346
Assignee | ||
Comment 6•10 years ago
|
||
master:
https://github.com/mozilla-b2g/gaia/commit/14a2fef47142cd873df27a6c846fcd9f854a75e6
Followon bug for tests: bug 1058872
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Comment 7•10 years ago
|
||
[Environment]
Gaia fbb297c39aab5f17b179533d2a9a6c5166b2c197
Gecko https://hg.mozilla.org/releases/mozilla-aurora/rev/fb5e796da813
BuildID 20140902160204
Version 34.0a2
ro.build.version.incremental=eng.cltbld.20140820.195518
ro.build.date=Wed Aug 20 19:55:28 EDT 2014
[Result]
PASS
Status: RESOLVED → VERIFIED
QA Contact: edchen
You need to log in
before you can comment on or make changes to this bug.
Description
•