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)
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}}
| Reporter | ||
Updated•10 years ago
|
blocking-b2g: --- → 2.6?
Whiteboard: [ft:conndevices]
| Reporter | ||
Updated•10 years ago
|
Component: Gaia::TV::Browser → Gaia::TV
| Reporter | ||
Comment 1•10 years ago
|
||
Hi Dan,
This is obvious display issue that should be fixed.
Flags: needinfo?(dhuang)
| Assignee | ||
Comment 3•10 years ago
|
||
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)
Updated•10 years ago
|
Assignee: nobody → dhuang
blocking-b2g: 2.6? → 2.6+
Comment 4•10 years ago
|
||
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 5•10 years ago
|
||
| Assignee | ||
Comment 6•10 years ago
|
||
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 7•10 years ago
|
||
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).
| Assignee | ||
Comment 8•10 years ago
|
||
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 9•10 years ago
|
||
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+
| Assignee | ||
Comment 10•10 years ago
|
||
Thanks for the review.
Merge in master: https://github.com/mozilla-b2g/gaia/commit/716376290569cb4a1eee81018077a89171ba8db5
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
| Reporter | ||
Comment 11•10 years ago
|
||
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.
Description
•