Closed
Bug 1035754
Opened 10 years ago
Closed 10 years ago
[Gaia][lock screen] support 24 hour time format
Categories
(Firefox OS Graveyard :: Gaia::System::Lockscreen, defect)
Tracking
(feature-b2g:2.1)
People
(Reporter: howie, Assigned: gweng)
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.
Reporter | ||
Comment 1•10 years ago
|
||
To have Greg as assignee for this bug first, will post more details after setting part is done, thanks.
Assignee: nobody → gweng
Reporter | ||
Updated•10 years ago
|
Target Milestone: --- → 2.1 S3 (29aug)
Comment 2•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 lock screen 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 | ||
Comment 3•10 years ago
|
||
Patch sent, thanks!
Attachment #8472836 -
Flags: review?(timdream)
Comment 4•10 years ago
|
||
Comment on attachment 8472836 [details]
Patch
date_time_helper.js probably need to load before lock screen to make sure the method exist. I didn't check it.
Also, you need to rebase the patch.
Attachment #8472836 -
Flags: review?(timdream) → review+
Assignee | ||
Comment 5•10 years ago
|
||
Rebased. Would land it.
Assignee | ||
Comment 6•10 years ago
|
||
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•