Skip to content

Commit

Permalink
[fixed] moment localizer
Browse files Browse the repository at this point in the history
  • Loading branch information
jquense committed Oct 12, 2015
1 parent a771321 commit 65e94f9
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 17 deletions.
2 changes: 2 additions & 0 deletions build/make-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ module.exports = function makeConfig(options){

externals: options.externals,

babel: options.babel,

resolve: {
extensions: ['', '.js', '.jsx'],
alias: {
Expand Down
17 changes: 17 additions & 0 deletions dev/configure-globalize.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
var Globalize = require('globalize')
var localizers = require('../src/localizers/globalize')

Globalize.load(
require('cldr-data/main/en-GB/ca-gregorian.json'),
require('cldr-data/main/en-GB/currencies.json'),
require('cldr-data/main/en-GB/dateFields.json'),
require('cldr-data/main/en-GB/numbers.json'),
require('cldr-data/supplemental/numberingSystems.json'),
require('cldr-data/supplemental/currencyData.json'),
require('cldr-data/supplemental/likelySubtags.json'),
require('cldr-data/supplemental/timeData.json'),
require('cldr-data/supplemental/weekData.json')
);
Globalize.locale('en-GB')

localizers(Globalize)
4 changes: 4 additions & 0 deletions dev/configure-moment.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
var moment = require('moment')
var localizers = require('../src/localizers/moment')

localizers(moment)
18 changes: 2 additions & 16 deletions dev/dev.jsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,10 @@
'use strict';
require('../src/less/react-widgets.less')
require('./configure-moment')

var Globalize = require('globalize')
var localizers = require('../src/localizers/globalize')
var numberLocalizer = require('../src/localizers/simple-number')

Globalize.load(
require('cldr-data/main/en-GB/ca-gregorian.json'),
require('cldr-data/main/en-GB/currencies.json'),
require('cldr-data/main/en-GB/dateFields.json'),
require('cldr-data/main/en-GB/numbers.json'),
require('cldr-data/supplemental/numberingSystems.json'),
require('cldr-data/supplemental/currencyData.json'),
require('cldr-data/supplemental/likelySubtags.json'),
require('cldr-data/supplemental/timeData.json'),
require('cldr-data/supplemental/weekData.json')
);
Globalize.locale('en-GB')

localizers(Globalize)

numberLocalizer()

var React = require('react/addons')
Expand Down
2 changes: 1 addition & 1 deletion src/localizers/moment.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default function(moment){
},

format(value, format, culture) {
return getMoment(culture, value, format).format(format)
return getMoment(culture, value).format(format)
}
}

Expand Down

0 comments on commit 65e94f9

Please sign in to comment.