Closed Bug 1264883 Opened 10 years ago Closed 10 years ago

[TV] Tab sync last updated is wrong

Categories

(Firefox OS Graveyard :: Gaia::TV, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-b2g:2.6+)

VERIFIED FIXED
blocking-b2g 2.6+

People

(Reporter: twen, Assigned: danhuang)

References

Details

(Whiteboard: [ft:conndevices])

Attachments

(1 file)

Tab sync should show the right time for last updated. It always displays "{{hours-ago-long}}" as last updated time. [Test Steps] 1. Sign in to Firefox account 2. Sync now - tabs checked 3. Go to default page and tap Tab Sync [Expected result] Last update: xx hours ago [Actual result] Last update: {{hours-ago-long}}
blocking-b2g: --- → 2.6?
Whiteboard: [ft:conndevices]
Component: Gaia::TV::Browser → Gaia::TV
Hi Dan, This is obvious display issue that should be fixed.
Flags: needinfo?(dhuang)
Got it!
Flags: needinfo?(dhuang)
Depends on: 1257905
Hi Zibi, I use i10n plural property from date.en-US.properties to display last update time in tv sync tab. Example: HTML: <span data-l10n-args="{'value':5}" data-l10n-id="fxsync-last-updated-more-than-a-day"</span> i10n property: fxsync-last-updated-more-than-a-day=Last updated: {{days-ago-long}} In bug 1257905, you move i10n plural property from date.en-US.properties to relativetimeformat.en-US.properties. Could you give me some advice to correct the code example above?
Flags: needinfo?(gandalf)
Assignee: nobody → dhuang
blocking-b2g: 2.6? → 2.6+
You should use mozIntl: let rtf = new mozIntl.RelativeTimeFormatter(navigator.languages, { unit: 'day' }); rtf.format(-5).then(val => { document.l10n.setAttributes(span, 'fxsync-last-updated-more-than-a-day', { 'daysAgo' : val }); }); and in l10n: fxsync-last-updated-more-than-a-day=Last updated: {{daysAgo}}
Flags: needinfo?(gandalf)
Comment on attachment 8744205 [details] [review] [gaia] danhuang1202:bug1264883_sync_tab_list_time_string_not_correct > mozilla-b2g:master Hi Zibi, Thanks for your advice! This patch use mozIntl to transform the time information in sync tab. Could you help review this patch?
Attachment #8744205 - Flags: review?(gandalf)
Comment on attachment 8744205 [details] [review] [gaia] danhuang1202:bug1264883_sync_tab_list_time_string_not_correct > mozilla-b2g:master Sure. Left a comment. RelativeTimeFormat can use unit: bestFit to pick the right unit based on the value of the integer (relative to now in seconds).
Comment on attachment 8744205 [details] [review] [gaia] danhuang1202:bug1264883_sync_tab_list_time_string_not_correct > mozilla-b2g:master Hi Zibi, I have update unit to 'bestFit' in this patch. It's really helpful!
Comment on attachment 8744205 [details] [review] [gaia] danhuang1202:bug1264883_sync_tab_list_time_string_not_correct > mozilla-b2g:master Looks great!
Attachment #8744205 - Flags: review?(gandalf) → review+
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Verified fixed on simulator. Time displays correctly.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: