Skip to content

Commit c688466

Browse files
committed
Merge pull request #6 from drewfish/mf-formats
updated for change in intl-messageformat API
2 parents b1a1b30 + bb9f26b commit c688466

File tree

1 file changed

+4
-19
lines changed

1 file changed

+4
-19
lines changed

tests/helpers.js

+4-19
Original file line numberDiff line numberDiff line change
@@ -575,27 +575,12 @@ describe('Helper `intl`', function () {
575575
it('for intlMessage', function () {
576576
var tmpl = '{@intl formats=intl.formats}{@intlMessage _msg=MSG product=PRODUCT price=PRICE deadline=DEADLINE timeZone=TZ/}{/intl}',
577577
ctx = {
578-
MSG: '{product} cost {price, usd} (or {price, eur}) if ordered by {deadline, date, medium}',
578+
MSG: '{product} cost {price, number, usd} (or {price, number, eur}) if ordered by {deadline, date, medium}',
579579
intl: {
580580
formats: {
581-
eur: function(val, locale, options) {
582-
return new intl.NumberFormat(locale, {
583-
style: 'currency',
584-
currency: 'EUR'
585-
}).format(val);
586-
},
587-
usd: function(val, locale, options) {
588-
return new intl.NumberFormat(locale, {
589-
style: 'currency',
590-
currency: 'USD'
591-
}).format(val);
592-
},
593-
ymd: function(val, locale, options) {
594-
return new intl.DateTimeFormat(locale, {
595-
year: 'numeric',
596-
month: 'numeric',
597-
day: 'numeric'
598-
}).format(val);
581+
number: {
582+
eur: { style: 'currency', currency: 'EUR' },
583+
usd: { style: 'currency', currency: 'USD' }
599584
}
600585
}
601586
},

0 commit comments

Comments
 (0)