Bug 1211668 - Migrate Cost Control from l10n_date to Intl API #32258
Bug 1211668 - Migrate Cost Control from l10n_date to Intl API #32258
Conversation
aad101c
to
e183e7c
Compare
@@ -112,8 +112,10 @@ var TelephonyTab = (function() { | |||
billingCycle.hidden = true; | |||
} else { | |||
billingCycle.hidden = false; | |||
var content = Formatting.getFormattedDate(settings.nextReset, | |||
_('short-date-format')); | |||
var content = Formatting.getFormattedDate(settings.nextReset, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about exposing the object replacing _('short-date-format')
as a getter in the Formatting
object? For instance:
Formatting.getFormattedDate(settings.nextReset, Formatting.formats.shortDate)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I cached the formatters and added code to reset them on language/timeformat changes.
e183e7c
to
9ae90ac
Compare
9ae90ac
to
103d5b0
Compare
103d5b0
to
4f850af
Compare
computeTelephonyMinutes: computeTelephonyMinutes | ||
computeTelephonyMinutes: computeTelephonyMinutes, | ||
|
||
formats: {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see you cached the formatters, not the formats. What I was asking was to cache the formats. Caching formatters mean you need to listen for those events in lines 239 and 240 although it mean to save some overhead when displaying a date. I'm ok with caching formatters but then change the map name from formats
to formatters
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deal! :) Yeah, I misunderstood you, but I think the outcome is good. We are caching what should be cached :)
4f850af
to
0c91f6e
Compare
…-to-intl-api Bug 1211668 - Migrate Cost Control from l10n_date to Intl API. r=salva
https://bugzilla.mozilla.org/show_bug.cgi?id=1211668