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)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(feature-b2g:2.1)

VERIFIED FIXED
2.1 S3 (29aug)
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.
QA Whiteboard: [COM=Productivity]
QA Whiteboard: [COM=Productivity] → [COM=Gaia::Clock]
Target Milestone: --- → 2.1 S3 (29aug)
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
Assignee: nobody → m
Working on this today; should have a patch up shortly.
Status: NEW → ASSIGNED
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)
Attachment #8478572 - Flags: review?(mmedeiros) → review+
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
[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
Depends on: 1071988
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: