Closed Bug 1035761 Opened 10 years ago Closed 10 years ago

[B2G][Cost Control] support 24 hour time format

Categories

(Firefox OS Graveyard :: Gaia::Cost Control, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(feature-b2g:2.1, b2g-v2.1 verified)

VERIFIED FIXED
2.1 S3 (29aug)
feature-b2g 2.1
Tracking Status
b2g-v2.1 --- verified

People

(Reporter: howie, Assigned: salva)

References

Details

Attachments

(2 files)

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.
Hi Daniel, there is 12/24 hour time format work for cost control in FX OS 2.1. Will you be able to take this? Thank you!
Flags: needinfo?(dcoloma)
Flags: needinfo?(dcoloma)
Hi Maria, have you found developer for this? The work may start after dependent bug 1023735 is fixed, around Aug 18th. Thank you!
Flags: needinfo?(oteo)
Sure, Salva can work in it as Marina in in PTO until end of August.
Salva, can you assign the bug to yourself? thanks a lot!
Flags: needinfo?(oteo) → needinfo?(salva)
Sure! Assigning to me!
Assignee: nobody → salva
Flags: needinfo?(salva)
Test steps:

1. Open settings app
2. change the Time format settings in Settings > Date & Time > Time Format panel

Expect:

The time format in cost control 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
Hi Salva, the Settings app work is done and you may start the bug now :)

The detail is in Comment 5, feel free to let us know if there's any question, thank you!
Flags: needinfo?(salva)
Target Milestone: --- → 2.1 S3 (29aug)
Sorry for the delay :howie but I was attending bug 1043662 which is 2.0+

I'm working on this one right now.
Flags: needinfo?(salva)
Attachment #8475816 - Flags: review?(jmcf) → review?(francisco)
Comment on attachment 8475816 [details] [review]
Add support for 24h / 12h time format changes.

Excellent job here.

Just left a super tiny comment, but apart from that r+
Attachment #8475816 - Flags: review?(francisco) → review+
master: e410e931c53bf4d67b09e90bc4e57baadc580a8e
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Thanks everyone!
QA Contact: lolimartinezcr
Tested and working but it * isn't verified * because we need to test hour time format in balance with a prepaid SIM card with coverage.

Flame
2.1
Gecko-2fbbb04
Gaia-59bd661
Cost control properly updates its time based on the format specified in settings with both Postpaid, and Prepaid SIM cards. However, I am unable to verify this bug until the depends on bug is verified first (bug 1023735)
QA Whiteboard: [QAnalyst-Triage?][QAnalyst-verify-]
Flags: needinfo?(ktucker)
QA Whiteboard: [QAnalyst-Triage?][QAnalyst-verify-] → [QAnalyst-Triage+]
Flags: needinfo?(ktucker)
Attached image screenshot
This issue has been verified successfully on Flame 2.1
See attachment: Flame2.1_screenshot.png
Reproducing rate: 0/3
Reproducing steps:
1. Open settings app
2. Date & Time > Time Format
** The 24-hour time format has been added.

Flame 2.1 build:
Gaia-Rev        dbaf3e31c9ba9c3436e074381744f2971e15c7bf
Gecko-Rev       https://hg.mozilla.org/releases/mozilla-b2g34_v2_1/rev/ebce587d2194
Build-ID        20141203001205
Version         34.0
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: