Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Bug 1211668 - Migrate Cost Control from l10n_date to Intl API #32258

Conversation

zbraniecki
Copy link
Contributor

@mozilla-autolander-deprecated
Copy link
Contributor

@zbraniecki zbraniecki force-pushed the 1211668-migrate-costcontrol-to-intl-api branch from aad101c to e183e7c Compare October 6, 2015 07:00
@mozilla-autolander-deprecated
Copy link
Contributor

@@ -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, {
Copy link
Contributor

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)

Copy link
Contributor Author

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.

@zbraniecki zbraniecki force-pushed the 1211668-migrate-costcontrol-to-intl-api branch from e183e7c to 9ae90ac Compare October 8, 2015 22:17
@mozilla-autolander-deprecated
Copy link
Contributor

@zbraniecki zbraniecki force-pushed the 1211668-migrate-costcontrol-to-intl-api branch from 9ae90ac to 103d5b0 Compare October 8, 2015 22:17
@mozilla-autolander-deprecated
Copy link
Contributor

@zbraniecki zbraniecki force-pushed the 1211668-migrate-costcontrol-to-intl-api branch from 103d5b0 to 4f850af Compare October 8, 2015 22:21
@mozilla-autolander-deprecated
Copy link
Contributor

computeTelephonyMinutes: computeTelephonyMinutes
computeTelephonyMinutes: computeTelephonyMinutes,

formats: {}
Copy link
Contributor

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.

Copy link
Contributor Author

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 :)

@zbraniecki zbraniecki force-pushed the 1211668-migrate-costcontrol-to-intl-api branch from 4f850af to 0c91f6e Compare October 9, 2015 19:22
@mozilla-autolander-deprecated
Copy link
Contributor

zbraniecki added a commit that referenced this pull request Oct 9, 2015
…-to-intl-api

Bug 1211668 - Migrate Cost Control from l10n_date to Intl API. r=salva
@zbraniecki zbraniecki merged commit 02f4662 into mozilla-b2g:master Oct 9, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants