From: Felix Nagel Date: Mon, 27 Jul 2015 18:53:16 +0000 (+0200) Subject: Calendar: Update Globalize to 1.0.0 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f9ba50df661f5cf6c1e30320e8f943dd7018e0c8;p=jquery-ui.git Calendar: Update Globalize to 1.0.0 --- diff --git a/bower.json b/bower.json index 3070b7533..614e4f78a 100644 --- a/bower.json +++ b/bower.json @@ -19,7 +19,7 @@ "qunit-assert-close": "JamesMGreene/qunit-assert-close#v1.1.1", "qunit-composite": "JamesMGreene/qunit-composite#v1.1.0", "requirejs": "2.1.14", - "globalize": "1.0.0-alpha.7", + "globalize": "1.0.0", "jquery-1.7.0": "jquery#1.7.0", "jquery-1.7.1": "jquery#1.7.1", diff --git a/demos/calendar/buttonbar.html b/demos/calendar/buttonbar.html index 6af0072b7..52a07a32f 100644 --- a/demos/calendar/buttonbar.html +++ b/demos/calendar/buttonbar.html @@ -9,6 +9,7 @@ + diff --git a/demos/calendar/default.html b/demos/calendar/default.html index 301d49eeb..c83b8f85d 100644 --- a/demos/calendar/default.html +++ b/demos/calendar/default.html @@ -9,6 +9,7 @@ + diff --git a/demos/calendar/dropdown-month-year.html b/demos/calendar/dropdown-month-year.html index 49fb10c19..fbb4b7b85 100644 --- a/demos/calendar/dropdown-month-year.html +++ b/demos/calendar/dropdown-month-year.html @@ -9,6 +9,7 @@ + diff --git a/demos/calendar/localization.html b/demos/calendar/localization.html index 105b41c02..1307052ef 100644 --- a/demos/calendar/localization.html +++ b/demos/calendar/localization.html @@ -9,6 +9,7 @@ + diff --git a/demos/calendar/min-max.html b/demos/calendar/min-max.html index e1af1c997..f8af39bd2 100644 --- a/demos/calendar/min-max.html +++ b/demos/calendar/min-max.html @@ -9,6 +9,7 @@ + diff --git a/demos/calendar/multiple-months.html b/demos/calendar/multiple-months.html index dd0e435a2..22118abaa 100644 --- a/demos/calendar/multiple-months.html +++ b/demos/calendar/multiple-months.html @@ -9,6 +9,7 @@ + diff --git a/demos/calendar/other-months.html b/demos/calendar/other-months.html index 492777e38..ef43f7b82 100644 --- a/demos/calendar/other-months.html +++ b/demos/calendar/other-months.html @@ -9,6 +9,7 @@ + diff --git a/demos/calendar/show-week.html b/demos/calendar/show-week.html index 63e8b9fcd..dfa762405 100644 --- a/demos/calendar/show-week.html +++ b/demos/calendar/show-week.html @@ -9,6 +9,7 @@ + diff --git a/external/cldrjs/LICENSE-MIT/LICENSE-MIT b/external/cldrjs/LICENSE-MIT/LICENSE-MIT index 6db134a69..6123defa8 100644 --- a/external/cldrjs/LICENSE-MIT/LICENSE-MIT +++ b/external/cldrjs/LICENSE-MIT/LICENSE-MIT @@ -1,4 +1,4 @@ -Copyright (c) 2013 Rafael Xavier de Souza http://rafael.xavier.blog.br +Copyright (c) Rafael Xavier de Souza http://rafael.xavier.blog.br Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation diff --git a/external/cldrjs/cldr.js b/external/cldrjs/cldr.js index 95515ba85..5b3c637a8 100644 --- a/external/cldrjs/cldr.js +++ b/external/cldrjs/cldr.js @@ -1,15 +1,15 @@ /** - * CLDR JavaScript Library v0.3.8 + * CLDR JavaScript Library v0.4.1 * http://jquery.com/ * * Copyright 2013 Rafael Xavier de Souza * Released under the MIT license * http://jquery.org/license * - * Date: 2014-07-13T05:05Z + * Date: 2015-02-25T13:51Z */ /*! - * CLDR JavaScript Library v0.3.8 2014-07-13T05:05Z MIT license © Rafael Xavier + * CLDR JavaScript Library v0.4.1 2015-02-25T13:51Z MIT license © Rafael Xavier * http://git.io/h4lmVg */ (function( root, factory ) { @@ -28,85 +28,6 @@ }( this, function() { - - var arrayForEach = function( array, callback ) { - var i, length; - if ( array.forEach ) { - return array.forEach( callback ); - } - for ( i = 0, length = array.length; i < length; i++ ) { - callback( array[ i ], i, array ); - } - }; - - - - - var objectKeys = function( object ) { - var i, - result = []; - - if ( Object.keys ) { - return Object.keys( object ); - } - - for ( i in object ) { - result.push( i ); - } - - return result; - }; - - - - - var createError = function( code, attributes ) { - var error, message; - - message = code + ( attributes && JSON ? ": " + JSON.stringify( attributes ) : "" ); - error = new Error( message ); - error.code = code; - - // extend( error, attributes ); - arrayForEach( objectKeys( attributes ), function( attribute ) { - error[ attribute ] = attributes[ attribute ]; - }); - - return error; - }; - - - - - var validate = function( code, check, attributes ) { - if ( !check ) { - throw createError( code, attributes ); - } - }; - - - - - var validatePresence = function( value, name ) { - validate( "E_MISSING_PARAMETER", typeof value !== "undefined", { - name: name - }); - }; - - - - - var validateType = function( value, name, check, expected ) { - validate( "E_INVALID_PAR_TYPE", check, { - expected: expected, - name: name, - value: value - }); - }; - - - - var arrayIsArray = Array.isArray || function( obj ) { return Object.prototype.toString.call( obj ) === "[object Array]"; }; @@ -114,37 +35,6 @@ - var validateTypePath = function( value, name ) { - validateType( value, name, typeof value === "string" || arrayIsArray( value ), "String or Array" ); - }; - - - - - /** - * Function inspired by jQuery Core, but reduced to our use case. - */ - var isPlainObject = function( obj ) { - return obj !== null && "" + obj === "[object Object]"; - }; - - - - - var validateTypePlainObject = function( value, name ) { - validateType( value, name, typeof value === "undefined" || isPlainObject( value ), "Plain Object" ); - }; - - - - - var validateTypeString = function( value, name ) { - validateType( value, name, typeof value === "string", "a string" ); - }; - - - - var pathNormalize = function( path, attributes ) { if ( arrayIsArray( path ) ) { path = path.join( "/" ); @@ -315,6 +205,200 @@ + /** + * subtags( locale ) + * + * @locale [String] + */ + var coreSubtags = function( locale ) { + var aux, unicodeLanguageId, + subtags = []; + + locale = locale.replace( /_/, "-" ); + + // Unicode locale extensions. + aux = locale.split( "-u-" ); + if ( aux[ 1 ] ) { + aux[ 1 ] = aux[ 1 ].split( "-t-" ); + locale = aux[ 0 ] + ( aux[ 1 ][ 1 ] ? "-t-" + aux[ 1 ][ 1 ] : ""); + subtags[ 4 /* unicodeLocaleExtensions */ ] = aux[ 1 ][ 0 ]; + } + + // TODO normalize transformed extensions. Currently, skipped. + // subtags[ x ] = locale.split( "-t-" )[ 1 ]; + unicodeLanguageId = locale.split( "-t-" )[ 0 ]; + + // unicode_language_id = "root" + // | unicode_language_subtag + // (sep unicode_script_subtag)? + // (sep unicode_region_subtag)? + // (sep unicode_variant_subtag)* ; + // + // Although unicode_language_subtag = alpha{2,8}, I'm using alpha{2,3}. Because, there's no language on CLDR lengthier than 3. + aux = unicodeLanguageId.match( /^(([a-z]{2,3})(-([A-Z][a-z]{3}))?(-([A-Z]{2}|[0-9]{3}))?)(-[a-zA-Z0-9]{5,8}|[0-9][a-zA-Z0-9]{3})*$|^(root)$/ ); + if ( aux === null ) { + return [ "und", "Zzzz", "ZZ" ]; + } + subtags[ 0 /* language */ ] = aux[ 9 ] /* root */ || aux[ 2 ] || "und"; + subtags[ 1 /* script */ ] = aux[ 4 ] || "Zzzz"; + subtags[ 2 /* territory */ ] = aux[ 6 ] || "ZZ"; + subtags[ 3 /* variant */ ] = aux[ 7 ]; + + // 0: language + // 1: script + // 2: territory (aka region) + // 3: variant + // 4: unicodeLocaleExtensions + return subtags; + }; + + + + + var arrayForEach = function( array, callback ) { + var i, length; + if ( array.forEach ) { + return array.forEach( callback ); + } + for ( i = 0, length = array.length; i < length; i++ ) { + callback( array[ i ], i, array ); + } + }; + + + + + /** + * bundleLookup( minLanguageId ) + * + * @Cldr [Cldr class] + * + * @cldr [Cldr instance] + * + * @minLanguageId [String] requested languageId after applied remove likely subtags. + */ + var bundleLookup = function( Cldr, cldr, minLanguageId ) { + var availableBundleMap = Cldr._availableBundleMap, + availableBundleMapQueue = Cldr._availableBundleMapQueue; + + if ( availableBundleMapQueue.length ) { + arrayForEach( availableBundleMapQueue, function( bundle ) { + var existing, maxBundle, minBundle, subtags; + subtags = coreSubtags( bundle ); + maxBundle = coreLikelySubtags( Cldr, cldr, subtags, { force: true } ) || subtags; + minBundle = coreRemoveLikelySubtags( Cldr, cldr, maxBundle ); + minBundle = minBundle.join( Cldr.localeSep ); + existing = availableBundleMapQueue[ minBundle ]; + if ( existing && existing.length < bundle.length ) { + return; + } + availableBundleMap[ minBundle ] = bundle; + }); + Cldr._availableBundleMapQueue = []; + } + + return availableBundleMap[ minLanguageId ] || null; + }; + + + + + var objectKeys = function( object ) { + var i, + result = []; + + if ( Object.keys ) { + return Object.keys( object ); + } + + for ( i in object ) { + result.push( i ); + } + + return result; + }; + + + + + var createError = function( code, attributes ) { + var error, message; + + message = code + ( attributes && JSON ? ": " + JSON.stringify( attributes ) : "" ); + error = new Error( message ); + error.code = code; + + // extend( error, attributes ); + arrayForEach( objectKeys( attributes ), function( attribute ) { + error[ attribute ] = attributes[ attribute ]; + }); + + return error; + }; + + + + + var validate = function( code, check, attributes ) { + if ( !check ) { + throw createError( code, attributes ); + } + }; + + + + + var validatePresence = function( value, name ) { + validate( "E_MISSING_PARAMETER", typeof value !== "undefined", { + name: name + }); + }; + + + + + var validateType = function( value, name, check, expected ) { + validate( "E_INVALID_PAR_TYPE", check, { + expected: expected, + name: name, + value: value + }); + }; + + + + + var validateTypePath = function( value, name ) { + validateType( value, name, typeof value === "string" || arrayIsArray( value ), "String or Array" ); + }; + + + + + /** + * Function inspired by jQuery Core, but reduced to our use case. + */ + var isPlainObject = function( obj ) { + return obj !== null && "" + obj === "[object Object]"; + }; + + + + + var validateTypePlainObject = function( value, name ) { + validateType( value, name, typeof value === "undefined" || isPlainObject( value ), "Plain Object" ); + }; + + + + + var validateTypeString = function( value, name ) { + validateType( value, name, typeof value === "string", "a string" ); + }; + + + + // @path: normalized path var resourceGet = function( data, path ) { var i, @@ -333,18 +417,33 @@ - var itemGetResolved = function( Cldr, path, attributes ) { - // Resolve path - var normalizedPath = pathNormalize( path, attributes ); - - return resourceGet( Cldr._resolved, normalizedPath ); + /** + * setAvailableBundles( Cldr, json ) + * + * @Cldr [Cldr class] + * + * @json resolved/unresolved cldr data. + * + * Set available bundles queue based on passed json CLDR data. Considers a bundle as any String at /main/{bundle}. + */ + var coreSetAvailableBundles = function( Cldr, json ) { + var bundle, + availableBundleMapQueue = Cldr._availableBundleMapQueue, + main = resourceGet( json, [ "main" ] ); + + if ( main ) { + for ( bundle in main ) { + if ( main.hasOwnProperty( bundle ) && bundle !== "root" ) { + availableBundleMapQueue.push( bundle ); + } + } + } }; - - var alwaysArray = function( stringOrArray ) { - return typeof stringOrArray === "string" ? [ stringOrArray ] : stringOrArray; + var alwaysArray = function( somethingOrArray ) { + return arrayIsArray( somethingOrArray ) ? somethingOrArray : [ somethingOrArray ]; }; @@ -390,6 +489,48 @@ }()); + /** + * load( Cldr, source, jsons ) + * + * @Cldr [Cldr class] + * + * @source [Object] + * + * @jsons [arguments] + */ + var coreLoad = function( Cldr, source, jsons ) { + var i, j, json; + + validatePresence( jsons[ 0 ], "json" ); + + // Support arbitrary parameters, e.g., `Cldr.load({...}, {...})`. + for ( i = 0; i < jsons.length; i++ ) { + + // Support array parameters, e.g., `Cldr.load([{...}, {...}])`. + json = alwaysArray( jsons[ i ] ); + + for ( j = 0; j < json.length; j++ ) { + validateTypePlainObject( json[ j ], "json" ); + source = jsonMerge( source, json[ j ] ); + coreSetAvailableBundles( Cldr, json[ j ] ); + } + } + + return source; + }; + + + + var itemGetResolved = function( Cldr, path, attributes ) { + // Resolve path + var normalizedPath = pathNormalize( path, attributes ); + + return resourceGet( Cldr._resolved, normalizedPath ); + }; + + + + /** * new Cldr() */ @@ -399,6 +540,7 @@ // Build optimization hack to avoid duplicating functions across modules. Cldr._alwaysArray = alwaysArray; + Cldr._coreLoad = coreLoad; Cldr._createError = createError; Cldr._itemGetResolved = itemGetResolved; Cldr._jsonMerge = jsonMerge; @@ -409,29 +551,39 @@ Cldr._validateTypePath = validateTypePath; Cldr._validateTypePlainObject = validateTypePlainObject; + Cldr._availableBundleMap = {}; + Cldr._availableBundleMapQueue = []; Cldr._resolved = {}; // Allow user to override locale separator "-" (default) | "_". According to http://www.unicode.org/reports/tr35/#Unicode_language_identifier, both "-" and "_" are valid locale separators (eg. "en_GB", "en-GB"). According to http://unicode.org/cldr/trac/ticket/6786 its usage must be consistent throughout the data set. Cldr.localeSep = "-"; - // Load resolved cldr data - // @json [JSON] - Cldr.load = function( json ) { - validatePresence( json, "json" ); - validateTypePlainObject( json, "json" ); - Cldr._resolved = jsonMerge( Cldr._resolved, json ); + /** + * Cldr.load( json [, json, ...] ) + * + * @json [JSON] CLDR data or [Array] Array of @json's. + * + * Load resolved cldr data. + */ + Cldr.load = function() { + Cldr._resolved = coreLoad( Cldr, Cldr._resolved, arguments ); }; /** * .init() automatically run on instantiation/construction. */ Cldr.prototype.init = function( locale ) { - var language, languageId, maxLanguageId, script, territory, unicodeLanguageId, variant, + var attributes, language, maxLanguageId, minLanguageId, script, subtags, territory, unicodeLocaleExtensions, variant, sep = Cldr.localeSep; validatePresence( locale, "locale" ); validateTypeString( locale, "locale" ); + subtags = coreSubtags( locale ); + + unicodeLocaleExtensions = subtags[ 4 ]; + variant = subtags[ 3 ]; + // Normalize locale code. // Get (or deduce) the "triple subtags": language, territory (also aliased as region), and script subtags. // Get the variant subtags (calendar, collation, currency, etc). @@ -440,73 +592,20 @@ // - http://www.unicode.org/reports/tr35/#Language_and_Locale_IDs // - http://www.unicode.org/reports/tr35/#Unicode_locale_identifier - locale = locale.replace( /-/, "_" ); - - // TODO normalize unicode locale extensions. Currently, skipped. - // unicodeLocaleExtensions = locale.split( "_u_" )[ 1 ]; - locale = locale.split( "_u_" )[ 0 ]; - - // TODO normalize transformed extensions. Currently, skipped. - // transformedExtensions = locale.split( "_t_" )[ 1 ]; - locale = locale.split( "_t_" )[ 0 ]; - - unicodeLanguageId = locale; - - // unicodeLanguageId = ... - switch ( true ) { - - // language_script_territory.. - case /^[a-z]{2,3}_[A-Z][a-z]{3}_[A-Z0-9]{2}(\b|_)/.test( unicodeLanguageId ): - language = unicodeLanguageId.split( "_" )[ 0 ]; - script = unicodeLanguageId.split( "_" )[ 1 ]; - territory = unicodeLanguageId.split( "_" )[ 2 ]; - variant = unicodeLanguageId.split( "_" )[ 3 ]; - break; - - // language_script.. - case /^[a-z]{2,3}_[A-Z][a-z]{3}(\b|_)/.test( unicodeLanguageId ): - language = unicodeLanguageId.split( "_" )[ 0 ]; - script = unicodeLanguageId.split( "_" )[ 1 ]; - territory = "ZZ"; - variant = unicodeLanguageId.split( "_" )[ 2 ]; - break; - - // language_territory.. - case /^[a-z]{2,3}_[A-Z0-9]{2}(\b|_)/.test( unicodeLanguageId ): - language = unicodeLanguageId.split( "_" )[ 0 ]; - script = "Zzzz"; - territory = unicodeLanguageId.split( "_" )[ 1 ]; - variant = unicodeLanguageId.split( "_" )[ 2 ]; - break; - - // language.., or root - case /^([a-z]{2,3}|root)(\b|_)/.test( unicodeLanguageId ): - language = unicodeLanguageId.split( "_" )[ 0 ]; - script = "Zzzz"; - territory = "ZZ"; - variant = unicodeLanguageId.split( "_" )[ 1 ]; - break; - - default: - language = "und"; - script = "Zzzz"; - territory = "ZZ"; - break; - } - // When a locale id does not specify a language, or territory (region), or script, they are obtained by Likely Subtags. - maxLanguageId = coreLikelySubtags( Cldr, this, [ language, script, territory ], { force: true } ) || unicodeLanguageId.split( "_" ); + maxLanguageId = coreLikelySubtags( Cldr, this, subtags, { force: true } ) || subtags; language = maxLanguageId[ 0 ]; script = maxLanguageId[ 1 ]; - territory = maxLanguageId[ 2 ]; + territory = maxLanguageId[ 2 ]; - languageId = coreRemoveLikelySubtags( Cldr, this, maxLanguageId ).join( sep ); + minLanguageId = coreRemoveLikelySubtags( Cldr, this, maxLanguageId ).join( sep ); // Set attributes - this.attributes = { + this.attributes = attributes = { + bundle: bundleLookup( Cldr, this, minLanguageId ), // Unicode Language Id - languageId: languageId, + minlanguageId: minLanguageId, maxLanguageId: maxLanguageId.join( sep ), // Unicode Language Id Subtabs @@ -517,7 +616,21 @@ variant: variant }; - this.locale = variant ? [ languageId, variant ].join( sep ) : languageId; + // Unicode locale extensions. + unicodeLocaleExtensions && ( "-" + unicodeLocaleExtensions ).replace( /-[a-z]{3,8}|(-[a-z]{2})-([a-z]{3,8})/g, function( attribute, key, type ) { + + if ( key ) { + + // Extension is in the `keyword` form. + attributes[ "u" + key ] = type; + } else { + + // Extension is in the `attribute` form. + attributes[ "u" + attribute ] = true; + } + }); + + this.locale = locale; }; /** @@ -538,12 +651,17 @@ validatePresence( path, "path" ); validateTypePath( path, "path" ); + validate( "E_MISSING_BUNDLE", this.attributes.bundle !== null, { + locale: this.locale + }); + path = alwaysArray( path ); - return this.get( [ "main/{languageId}" ].concat( path ) ); + return this.get( [ "main/{bundle}" ].concat( path ) ); }; return Cldr; + })); diff --git a/external/cldrjs/cldr/event.js b/external/cldrjs/cldr/event.js index 46c95af53..f9eaa368b 100644 --- a/external/cldrjs/cldr/event.js +++ b/external/cldrjs/cldr/event.js @@ -1,15 +1,15 @@ /** - * CLDR JavaScript Library v0.3.8 + * CLDR JavaScript Library v0.4.1 * http://jquery.com/ * * Copyright 2013 Rafael Xavier de Souza * Released under the MIT license * http://jquery.org/license * - * Date: 2014-07-13T05:05Z + * Date: 2015-02-25T13:51Z */ /*! - * CLDR JavaScript Library v0.3.8 2014-07-13T05:05Z MIT license © Rafael Xavier + * CLDR JavaScript Library v0.4.1 2015-02-25T13:51Z MIT license © Rafael Xavier * http://git.io/h4lmVg */ (function( factory ) { @@ -32,7 +32,6 @@ validatePresence = Cldr._validatePresence, validateType = Cldr._validateType; - /*! * EventEmitter v4.2.7 - git.io/ee * Oliver Caldwell @@ -582,4 +581,5 @@ EventEmitter = (function () { + })); diff --git a/external/cldrjs/cldr/supplemental.js b/external/cldrjs/cldr/supplemental.js index 989344b61..87153683c 100644 --- a/external/cldrjs/cldr/supplemental.js +++ b/external/cldrjs/cldr/supplemental.js @@ -1,15 +1,15 @@ /** - * CLDR JavaScript Library v0.3.8 + * CLDR JavaScript Library v0.4.1 * http://jquery.com/ * * Copyright 2013 Rafael Xavier de Souza * Released under the MIT license * http://jquery.org/license * - * Date: 2014-07-13T05:05Z + * Date: 2015-02-25T13:51Z */ /*! - * CLDR JavaScript Library v0.3.8 2014-07-13T05:05Z MIT license © Rafael Xavier + * CLDR JavaScript Library v0.4.1 2015-02-25T13:51Z MIT license © Rafael Xavier * http://git.io/h4lmVg */ (function( factory ) { @@ -32,7 +32,6 @@ - var supplementalMain = function( cldr ) { var prepend, supplemental; @@ -98,4 +97,5 @@ + })); diff --git a/external/globalize/LICENSE.txt b/external/globalize/LICENSE.txt index 5dee5ca45..0f9f2e51c 100644 --- a/external/globalize/LICENSE.txt +++ b/external/globalize/LICENSE.txt @@ -1,5 +1,4 @@ -Copyright 2010, 2014 jQuery Foundation and other contributors, -https://jquery.org/ +Copyright jQuery Foundation and other contributors, https://jquery.org/ This software consists of voluntary contributions made by many individuals. For exact contribution history, see the revision history diff --git a/external/globalize/globalize.js b/external/globalize/globalize.js index f9ff01851..2f744ac64 100644 --- a/external/globalize/globalize.js +++ b/external/globalize/globalize.js @@ -1,13 +1,17 @@ -/*! - * Globalize v1.0.0-alpha.7 +/** + * Globalize v1.0.0 * * http://github.com/jquery/globalize * - * Copyright 2010, 2014 jQuery Foundation, Inc. and other contributors + * Copyright jQuery Foundation and other contributors * Released under the MIT license * http://jquery.org/license * - * Date: 2014-09-30T12:31Z + * Date: 2015-04-23T12:02Z + */ +/*! + * Globalize v1.0.0 2015-04-23T12:02Z Released under the MIT license + * http://git.io/TrdQbw */ (function( root, factory ) { @@ -54,7 +58,7 @@ var toString = function( variable ) { * * Return the formatted message. For example: * - * - formatMessage( "{0} second", 1 ); // 1 second + * - formatMessage( "{0} second", [ 1 ] ); // 1 second * * - formatMessage( "{0}/{1}", ["m", "s"] ); // m/s * @@ -77,6 +81,23 @@ var formatMessage = function( message, data ) { +var objectExtend = function() { + var destination = arguments[ 0 ], + sources = [].slice.call( arguments, 1 ); + + sources.forEach(function( source ) { + var prop; + for ( prop in source ) { + destination[ prop ] = source[ prop ]; + } + }); + + return destination; +}; + + + + var createError = function( code, message, attributes ) { var error; @@ -84,10 +105,7 @@ var createError = function( code, message, attributes ) { error = new Error( message ); error.code = code; - // extend( error, attributes ); - Object.keys( attributes ).forEach(function( attribute ) { - error[ attribute ] = attributes[ attribute ]; - }); + objectExtend( error, attributes ); return error; }; @@ -228,6 +246,28 @@ var alwaysCldr = function( localeOrCldr ) { +// ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions?redirectlocale=en-US&redirectslug=JavaScript%2FGuide%2FRegular_Expressions +var regexpEscape = function( string ) { + return string.replace( /([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1" ); +}; + + + + +var stringPad = function( str, count, right ) { + var length; + if ( typeof str !== "string" ) { + str = String( str ); + } + for ( length = str.length; length < count; length += 1 ) { + str = ( right ? ( str + "0" ) : ( "0" + str ) ); + } + return str; +}; + + + + function validateLikelySubtags( cldr ) { cldr.once( "get", validateCldr ); cldr.get( "supplemental/likelySubtags" ); @@ -256,18 +296,16 @@ function Globalize( locale ) { } /** - * Globalize.load( json ) + * Globalize.load( json, ... ) * * @json [JSON] * * Load resolved or unresolved cldr data. * Somewhat equivalent to previous Globalize.addCultureInfo(...). */ -Globalize.load = function( json ) { - validateParameterPresence( json, "json" ); - validateParameterTypePlainObject( json, "json" ); - - Cldr.load( json ); +Globalize.load = function() { + // validations are delegated to Cldr.load(). + Cldr.load.apply( Cldr, arguments ); }; /** @@ -298,6 +336,9 @@ Globalize._alwaysArray = alwaysArray; Globalize._createError = createError; Globalize._formatMessage = formatMessage; Globalize._isPlainObject = isPlainObject; +Globalize._objectExtend = objectExtend; +Globalize._regexpEscape = regexpEscape; +Globalize._stringPad = stringPad; Globalize._validate = validate; Globalize._validateCldr = validateCldr; Globalize._validateDefaultLocale = validateDefaultLocale; diff --git a/external/globalize/globalize/date.js b/external/globalize/globalize/date.js index 48d0080ac..9f26a105d 100644 --- a/external/globalize/globalize/date.js +++ b/external/globalize/globalize/date.js @@ -1,13 +1,17 @@ -/*! - * Globalize v1.0.0-alpha.7 +/** + * Globalize v1.0.0 * * http://github.com/jquery/globalize * - * Copyright 2010, 2014 jQuery Foundation, Inc. and other contributors + * Copyright jQuery Foundation and other contributors * Released under the MIT license * http://jquery.org/license * - * Date: 2014-09-30T12:31Z + * Date: 2015-04-23T12:02Z + */ +/*! + * Globalize v1.0.0 2015-04-23T12:02Z Released under the MIT license + * http://git.io/TrdQbw */ (function( root, factory ) { @@ -18,6 +22,7 @@ define([ "cldr", "../globalize", + "./number", "cldr/event", "cldr/supplemental" ], factory ); @@ -33,12 +38,17 @@ }(this, function( Cldr, Globalize ) { var createError = Globalize._createError, + createErrorUnsupportedFeature = Globalize._createErrorUnsupportedFeature, formatMessage = Globalize._formatMessage, - isPlainObject = Globalize._isPlainObject, + numberSymbol = Globalize._numberSymbol, + regexpEscape = Globalize._regexpEscape, + stringPad = Globalize._stringPad, validateCldr = Globalize._validateCldr, validateDefaultLocale = Globalize._validateDefaultLocale, validateParameterPresence = Globalize._validateParameterPresence, - validateParameterType = Globalize._validateParameterType; + validateParameterType = Globalize._validateParameterType, + validateParameterTypePlainObject = Globalize._validateParameterTypePlainObject, + validateParameterTypeString = Globalize._validateParameterTypeString; var validateParameterTypeDate = function( value, name ) { @@ -48,30 +58,6 @@ var validateParameterTypeDate = function( value, name ) { -var validateParameterTypeDatePattern = function( value, name ) { - validateParameterType( - value, - name, - value === undefined || typeof value === "string" || isPlainObject( value ), - "String or plain Object" - ); -}; - - - - -var validateParameterTypeString = function( value, name ) { - validateParameterType( - value, - name, - value === undefined || typeof value === "string", - "a string" - ); -}; - - - - var createErrorInvalidParameterValue = function( name, value ) { return createError( "E_INVALID_PAR_VALUE", "Invalid `{name}` value ({value}).", { name: name, @@ -83,14 +69,14 @@ var createErrorInvalidParameterValue = function( name, value ) { /** - * expandPattern( pattern, cldr ) + * expandPattern( options, cldr ) * - * @pattern [String or Object] if String, it's considered a skeleton. Object accepts: + * @options [Object] if String, it's considered a skeleton. Object accepts: * - skeleton: [String] lookup availableFormat; * - date: [String] ( "full" | "long" | "medium" | "short" ); * - time: [String] ( "full" | "long" | "medium" | "short" ); * - datetime: [String] ( "full" | "long" | "medium" | "short" ); - * - pattern: [String] For more info see datetime/format.js. + * - raw: [String] For more info see datetime/format.js. * * @cldr [Cldr instance]. * @@ -101,59 +87,78 @@ var createErrorInvalidParameterValue = function( name, value ) { * - { date: "full" } returns "EEEE, MMMM d, y"; * - { time: "full" } returns "h:mm:ss a zzzz"; * - { datetime: "full" } returns "EEEE, MMMM d, y 'at' h:mm:ss a zzzz"; - * - { pattern: "dd/mm" } returns "dd/mm"; + * - { raw: "dd/mm" } returns "dd/mm"; */ -var dateExpandPattern = function( pattern, cldr ) { - var result; - if ( typeof pattern === "string" ) { - pattern = { skeleton: pattern }; +var dateExpandPattern = function( options, cldr ) { + var dateSkeleton, result, skeleton, timeSkeleton, type; + + function combineDateTime( type, datePattern, timePattern ) { + return formatMessage( + cldr.main([ + "dates/calendars/gregorian/dateTimeFormats", + type + ]), + [ timePattern, datePattern ] + ); } switch ( true ) { - case "skeleton" in pattern: + case "skeleton" in options: + skeleton = options.skeleton; result = cldr.main([ "dates/calendars/gregorian/dateTimeFormats/availableFormats", - pattern.skeleton + skeleton ]); + if ( !result ) { + timeSkeleton = skeleton.split( /[^hHKkmsSAzZOvVXx]/ ).slice( -1 )[ 0 ]; + dateSkeleton = skeleton.split( /[^GyYuUrQqMLlwWdDFgEec]/ )[ 0 ]; + if ( /(MMMM|LLLL).*[Ec]/.test( dateSkeleton ) ) { + type = "full"; + } else if ( /MMMM/g.test( dateSkeleton ) ) { + type = "long"; + } else if ( /MMM/g.test( dateSkeleton ) || /LLL/g.test( dateSkeleton ) ) { + type = "medium"; + } else { + type = "short"; + } + result = combineDateTime( type, + cldr.main([ + "dates/calendars/gregorian/dateTimeFormats/availableFormats", + dateSkeleton + ]), + cldr.main([ + "dates/calendars/gregorian/dateTimeFormats/availableFormats", + timeSkeleton + ]) + ); + } break; - case "date" in pattern: - case "time" in pattern: + case "date" in options: + case "time" in options: result = cldr.main([ "dates/calendars/gregorian", - "date" in pattern ? "dateFormats" : "timeFormats", - ( pattern.date || pattern.time ) + "date" in options ? "dateFormats" : "timeFormats", + ( options.date || options.time ) ]); break; - case "datetime" in pattern: - result = cldr.main([ - "dates/calendars/gregorian/dateTimeFormats", - pattern.datetime - ]); - if ( result ) { - result = formatMessage( result, [ - cldr.main([ - "dates/calendars/gregorian/timeFormats", - pattern.datetime - ]), - cldr.main([ - "dates/calendars/gregorian/dateFormats", - pattern.datetime - ]) - ]); - } + case "datetime" in options: + result = combineDateTime( options.datetime, + cldr.main([ "dates/calendars/gregorian/dateFormats", options.datetime ]), + cldr.main([ "dates/calendars/gregorian/timeFormats", options.datetime ]) + ); break; - case "pattern" in pattern: - result = pattern.pattern; + case "raw" in options: + result = options.raw; break; default: throw createErrorInvalidParameterValue({ - name: "pattern", - value: pattern + name: "options", + value: options }); } @@ -270,20 +275,51 @@ var dateMillisecondsInDay = function( date ) { -var datePatternRe = (/([a-z])\1*|'[^']+'|''|./ig); +var datePatternRe = (/([a-z])\1*|'([^']|'')+'|''|./ig); -var stringPad = function( str, count, right ) { - var length; - if ( typeof str !== "string" ) { - str = String( str ); - } - for ( length = str.length; length < count; length += 1 ) { - str = ( right ? ( str + "0" ) : ( "0" + str ) ); - } - return str; +/** + * hourFormat( date, format, timeSeparator, formatNumber ) + * + * Return date's timezone offset according to the format passed. + * Eg for format when timezone offset is 180: + * - "+H;-H": -3 + * - "+HHmm;-HHmm": -0300 + * - "+HH:mm;-HH:mm": -03:00 + */ +var dateTimezoneHourFormat = function( date, format, timeSeparator, formatNumber ) { + var absOffset, + offset = date.getTimezoneOffset(); + + absOffset = Math.abs( offset ); + formatNumber = formatNumber || { + 1: function( value ) { + return stringPad( value, 1 ); + }, + 2: function( value ) { + return stringPad( value, 2 ); + } + }; + + return format + + // Pick the correct sign side (+ or -). + .split( ";" )[ offset > 0 ? 1 : 0 ] + + // Localize time separator + .replace( ":", timeSeparator ) + + // Update hours offset. + .replace( /HH?/, function( match ) { + return formatNumber[ match.length ]( Math.floor( absOffset / 60 ) ); + }) + + // Update minutes offset and return. + .replace( /mm/, function() { + return formatNumber[ 2 ]( absOffset % 60 ); + }); }; @@ -300,9 +336,11 @@ var stringPad = function( str, count, right ) { * * Disclosure: this function borrows excerpts of dojo/date/locale. */ -var dateFormat = function( date, properties ) { +var dateFormat = function( date, numberFormatters, properties ) { + var timeSeparator = properties.timeSeparator; + return properties.pattern.replace( datePatternRe, function( current ) { - var pad, ret, + var ret, chr = current.charAt( 0 ), length = current.length; @@ -312,6 +350,24 @@ var dateFormat = function( date, properties ) { chr = properties.preferredTime; } + if ( chr === "Z" ) { + // Z..ZZZ: same as "xxxx". + if ( length < 4 ) { + chr = "x"; + length = 4; + + // ZZZZ: same as "OOOO". + } else if ( length < 5 ) { + chr = "O"; + length = 4; + + // ZZZZZ: same as "XXXXX" + } else { + chr = "X"; + length = 5; + } + } + switch ( chr ) { // Era @@ -324,10 +380,10 @@ var dateFormat = function( date, properties ) { // Plain year. // The length specifies the padding, but for two letters it also specifies the // maximum length. - ret = String( date.getFullYear() ); - pad = true; + ret = date.getFullYear(); if ( length === 2 ) { - ret = ret.substr( ret.length - 2 ); + ret = String( ret ); + ret = +ret.substr( ret.length - 2 ); } break; @@ -343,24 +399,18 @@ var dateFormat = function( date, properties ) { properties.firstDay - properties.minDays ); - ret = String( ret.getFullYear() ); - pad = true; + ret = ret.getFullYear(); if ( length === 2 ) { - ret = ret.substr( ret.length - 2 ); + ret = String( ret ); + ret = +ret.substr( ret.length - 2 ); } break; - case "u": // Extended year. Need to be implemented. - case "U": // Cyclic year name. Need to be implemented. - throw new Error( "Not implemented" ); - // Quarter case "Q": case "q": ret = Math.ceil( ( date.getMonth() + 1 ) / 3 ); - if ( length <= 2 ) { - pad = true; - } else { + if ( length > 2 ) { ret = properties.quarters[ chr ][ length ][ ret ]; } break; @@ -369,9 +419,7 @@ var dateFormat = function( date, properties ) { case "M": case "L": ret = date.getMonth() + 1; - if ( length <= 2 ) { - pad = true; - } else { + if ( length > 2 ) { ret = properties.months[ chr ][ length ][ ret ]; } break; @@ -384,7 +432,6 @@ var dateFormat = function( date, properties ) { ret = dateDayOfWeek( dateStartOf( date, "year" ), properties.firstDay ); ret = Math.ceil( ( dateDayOfYear( date ) + ret ) / 7 ) - ( 7 - ret >= properties.minDays ? 0 : 1 ); - pad = true; break; case "W": @@ -398,12 +445,10 @@ var dateFormat = function( date, properties ) { // Day case "d": ret = date.getDate(); - pad = true; break; case "D": ret = dateDayOfYear( date ) + 1; - pad = true; break; case "F": @@ -411,10 +456,6 @@ var dateFormat = function( date, properties ) { ret = Math.floor( date.getDate() / 7 ) + 1; break; - case "g+": - // Modified Julian day. Need to be implemented. - throw new Error( "Not implemented" ); - // Week day case "e": case "c": @@ -422,7 +463,6 @@ var dateFormat = function( date, properties ) { // Range is [1-7] (deduced by example provided on documentation) // TODO Should pad with zeros (not specified in the docs)? ret = dateDayOfWeek( date, properties.firstDay ) + 1; - pad = true; break; } @@ -440,65 +480,93 @@ var dateFormat = function( date, properties ) { // Hour case "h": // 1-12 ret = ( date.getHours() % 12 ) || 12; - pad = true; break; case "H": // 0-23 ret = date.getHours(); - pad = true; break; case "K": // 0-11 ret = date.getHours() % 12; - pad = true; break; case "k": // 1-24 ret = date.getHours() || 24; - pad = true; break; // Minute case "m": ret = date.getMinutes(); - pad = true; break; // Second case "s": ret = date.getSeconds(); - pad = true; break; case "S": ret = Math.round( date.getMilliseconds() * Math.pow( 10, length - 3 ) ); - pad = true; break; case "A": ret = Math.round( dateMillisecondsInDay( date ) * Math.pow( 10, length - 3 ) ); - pad = true; break; // Zone - // see http://www.unicode.org/reports/tr35/tr35-dates.html#Using_Time_Zone_Names ? - // Need to be implemented. case "z": - case "Z": case "O": - case "v": - case "V": + // O: "{gmtFormat}+H;{gmtFormat}-H" or "{gmtZeroFormat}", eg. "GMT-8" or "GMT". + // OOOO: "{gmtFormat}{hourFormat}" or "{gmtZeroFormat}", eg. "GMT-08:00" or "GMT". + if ( date.getTimezoneOffset() === 0 ) { + ret = properties.gmtZeroFormat; + } else { + ret = dateTimezoneHourFormat( + date, + length < 4 ? "+H;-H" : properties.tzLongHourFormat, + timeSeparator, + numberFormatters + ); + ret = properties.gmtFormat.replace( /\{0\}/, ret ); + } + break; + case "X": + // Same as x*, except it uses "Z" for zero offset. + if ( date.getTimezoneOffset() === 0 ) { + ret = "Z"; + break; + } + + /* falls through */ case "x": - throw new Error( "Not implemented" ); + // x: hourFormat("+HH;-HH") + // xx or xxxx: hourFormat("+HHmm;-HHmm") + // xxx or xxxxx: hourFormat("+HH:mm;-HH:mm") + ret = length === 1 ? "+HH;-HH" : ( length % 2 ? "+HH:mm;-HH:mm" : "+HHmm;-HHmm" ); + ret = dateTimezoneHourFormat( date, ret, ":" ); + break; + + // timeSeparator + case ":": + ret = timeSeparator; + break; - // Anything else is considered a literal, including [ ,:/.'@#], chinese, japonese, and + // ' literals. + case "'": + current = current.replace( /''/, "'" ); + if ( length > 2 ) { + current = current.slice( 1, -1 ); + } + ret = current; + break; + + // Anything else is considered a literal, including [ ,:/.@#], chinese, japonese, and // arabic characters. default: - return current; + ret = current; } - if ( pad ) { - ret = stringPad( ret, length ); + if ( typeof ret === "number" ) { + ret = numberFormatters[ length ]( ret ); } return ret; }); @@ -520,12 +588,22 @@ var dateFormat = function( date, properties ) { * TODO Support other calendar types. */ var dateFormatProperties = function( pattern, cldr ) { - var properties = {}, + var properties = { + pattern: pattern, + timeSeparator: numberSymbol( "timeSeparator", cldr ) + }, widths = [ "abbreviated", "wide", "narrow" ]; - properties.pattern = pattern; + function setNumberFormatterPattern( pad ) { + if ( !properties.numberFormatters ) { + properties.numberFormatters = {}; + } + properties.numberFormatters[ pad ] = stringPad( "", pad ); + } + pattern.replace( datePatternRe, function( current ) { - var chr = current.charAt( 0 ), + var formatNumber, + chr = current.charAt( 0 ), length = current.length; if ( chr === "j" ) { @@ -534,6 +612,12 @@ var dateFormatProperties = function( pattern, cldr ) { properties.preferredTime = chr = cldr.supplemental.timeData.preferred(); } + // ZZZZ: same as "OOOO". + if ( chr === "Z" && length === 4 ) { + chr = "O"; + length = 4; + } + switch ( chr ) { // Era @@ -544,15 +628,24 @@ var dateFormatProperties = function( pattern, cldr ) { ]); break; + // Year + case "y": + // Plain year. + formatNumber = true; + break; + case "Y": // Year in "Week of Year" properties.firstDay = dateFirstDayOfWeek( cldr ); properties.minDays = cldr.supplemental.weekData.minDays(); + formatNumber = true; break; case "u": // Extended year. Need to be implemented. case "U": // Cyclic year name. Need to be implemented. - throw new Error( "Not implemented" ); + throw createErrorUnsupportedFeature({ + feature: "year pattern `" + chr + "`" + }); // Quarter case "Q": @@ -569,6 +662,8 @@ var dateFormatProperties = function( pattern, cldr ) { chr === "Q" ? "format" : "stand-alone", widths[ length - 3 ] ]); + } else { + formatNumber = true; } break; @@ -587,6 +682,8 @@ var dateFormatProperties = function( pattern, cldr ) { chr === "M" ? "format" : "stand-alone", widths[ length - 3 ] ]); + } else { + formatNumber = true; } break; @@ -595,13 +692,28 @@ var dateFormatProperties = function( pattern, cldr ) { case "W": properties.firstDay = dateFirstDayOfWeek( cldr ); properties.minDays = cldr.supplemental.weekData.minDays(); + formatNumber = true; break; + // Day + case "d": + case "D": + case "F": + formatNumber = true; + break; + + case "g": + // Modified Julian day. Need to be implemented. + throw createErrorUnsupportedFeature({ + feature: "Julian day pattern `g`" + }); + // Week day case "e": case "c": if ( length <= 2 ) { properties.firstDay = dateFirstDayOfWeek( cldr ); + formatNumber = true; break; } @@ -644,17 +756,48 @@ var dateFormatProperties = function( pattern, cldr ) { ); break; + // Hour + case "h": // 1-12 + case "H": // 0-23 + case "K": // 0-11 + case "k": // 1-24 + + // Minute + case "m": + + // Second + case "s": + case "S": + case "A": + formatNumber = true; + break; + // Zone - // see http://www.unicode.org/reports/tr35/tr35-dates.html#Using_Time_Zone_Names ? - // Need to be implemented. case "z": - case "Z": case "O": - case "v": - case "V": + // O: "{gmtFormat}+H;{gmtFormat}-H" or "{gmtZeroFormat}", eg. "GMT-8" or "GMT". + // OOOO: "{gmtFormat}{hourFormat}" or "{gmtZeroFormat}", eg. "GMT-08:00" or "GMT". + properties.gmtFormat = cldr.main( "dates/timeZoneNames/gmtFormat" ); + properties.gmtZeroFormat = cldr.main( "dates/timeZoneNames/gmtZeroFormat" ); + properties.tzLongHourFormat = cldr.main( "dates/timeZoneNames/hourFormat" ); + + /* falls through */ + case "Z": case "X": case "x": - throw new Error( "Not implemented" ); + setNumberFormatterPattern( 1 ); + setNumberFormatterPattern( 2 ); + break; + + case "v": + case "V": + throw createErrorUnsupportedFeature({ + feature: "timezone pattern `" + chr + "`" + }); + } + + if ( formatNumber ) { + setNumberFormatterPattern( length ); } }); @@ -664,6 +807,34 @@ var dateFormatProperties = function( pattern, cldr ) { +/** + * isLeapYear( year ) + * + * @year [Number] + * + * Returns an indication whether the specified year is a leap year. + */ +var dateIsLeapYear = function( year ) { + return new Date(year, 1, 29).getMonth() === 1; +}; + + + + +/** + * lastDayOfMonth( date ) + * + * @date [Date] + * + * Return the last day of the given date's month + */ +var dateLastDayOfMonth = function( date ) { + return new Date( date.getFullYear(), date.getMonth() + 1, 0).getDate(); +}; + + + + /** * Differently from native date.setDate(), this function returns a date whose * day remains inside the month boundaries. For example: @@ -696,11 +867,14 @@ var dateSetMonth = function( date, month ) { }; -var dateParse = (function() { -function outOfRange( value, low, high ) { + +var outOfRange = function( value, low, high ) { return value < low || value > high; -} +}; + + + /** * parse( value, tokens, properties ) @@ -713,8 +887,8 @@ function outOfRange( value, low, high ) { * * ref: http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Format_Patterns */ -return function( value, tokens, properties ) { - var amPm, era, hour, hour12, valid, +var dateParse = function( value, tokens, properties ) { + var amPm, day, daysOfYear, era, hour, hour12, timezoneOffset, valid, YEAR = 0, MONTH = 1, DAY = 2, @@ -757,7 +931,7 @@ return function( value, tokens, properties ) { // Year case "y": - value = +token.lexeme; + value = token.value; if ( length === 2 ) { if ( outOfRange( value, 0, 99 ) ) { return false; @@ -775,9 +949,9 @@ return function( value, tokens, properties ) { break; case "Y": // Year in "Week of Year" - case "u": // Extended year. Need to be implemented. - case "U": // Cyclic year name. Need to be implemented. - throw new Error( "Not implemented" ); + throw createErrorUnsupportedFeature({ + feature: "year pattern `" + chr + "`" + }); // Quarter (skip) case "Q": @@ -788,7 +962,7 @@ return function( value, tokens, properties ) { case "M": case "L": if ( length <= 2 ) { - value = +token.lexeme; + value = token.value; } else { value = +token.value; } @@ -806,21 +980,12 @@ return function( value, tokens, properties ) { // Day case "d": - value = +token.lexeme; - if ( outOfRange( value, 1, 31 ) ) { - return false; - } - dateSetDate( date, value ); + day = token.value; truncateAt.push( DAY ); break; case "D": - value = +token.lexeme; - if ( outOfRange( value, 1, 366 ) ) { - return false; - } - date.setMonth(0); - date.setDate( value ); + daysOfYear = token.value; truncateAt.push( DAY ); break; @@ -829,10 +994,6 @@ return function( value, tokens, properties ) { // Skip break; - case "g+": - // Modified Julian day. Need to be implemented. - throw new Error( "Not implemented" ); - // Week day case "e": case "c": @@ -848,7 +1009,7 @@ return function( value, tokens, properties ) { // Hour case "h": // 1-12 - value = +token.lexeme; + value = token.value; if ( outOfRange( value, 1, 12 ) ) { return false; } @@ -858,7 +1019,7 @@ return function( value, tokens, properties ) { break; case "K": // 0-11 - value = +token.lexeme; + value = token.value; if ( outOfRange( value, 0, 11 ) ) { return false; } @@ -868,7 +1029,7 @@ return function( value, tokens, properties ) { break; case "k": // 1-24 - value = +token.lexeme; + value = token.value; if ( outOfRange( value, 1, 24 ) ) { return false; } @@ -878,7 +1039,7 @@ return function( value, tokens, properties ) { break; case "H": // 0-23 - value = +token.lexeme; + value = token.value; if ( outOfRange( value, 0, 23 ) ) { return false; } @@ -889,7 +1050,7 @@ return function( value, tokens, properties ) { // Minute case "m": - value = +token.lexeme; + value = token.value; if ( outOfRange( value, 0, 59 ) ) { return false; } @@ -899,7 +1060,7 @@ return function( value, tokens, properties ) { // Second case "s": - value = +token.lexeme; + value = token.value; if ( outOfRange( value, 0, 59 ) ) { return false; } @@ -914,22 +1075,19 @@ return function( value, tokens, properties ) { /* falls through */ case "S": - value = Math.round( +token.lexeme * Math.pow( 10, 3 - length ) ); + value = Math.round( token.value * Math.pow( 10, 3 - length ) ); date.setMilliseconds( value ); truncateAt.push( MILLISECONDS ); break; // Zone - // see http://www.unicode.org/reports/tr35/tr35-dates.html#Using_Time_Zone_Names ? - // Need to be implemented. - case "z": case "Z": + case "z": case "O": - case "v": - case "V": case "X": case "x": - throw new Error( "Not implemented" ); + timezoneOffset = token.value - date.getTimezoneOffset(); + break; } return true; @@ -950,10 +1108,27 @@ return function( value, tokens, properties ) { date.setFullYear( date.getFullYear() * -1 + 1 ); } + if ( day !== undefined ) { + if ( outOfRange( day, 1, dateLastDayOfMonth( date ) ) ) { + return null; + } + date.setDate( day ); + } else if ( daysOfYear !== undefined ) { + if ( outOfRange( daysOfYear, 1, dateIsLeapYear( date.getFullYear() ) ? 366 : 365 ) ) { + return null; + } + date.setMonth(0); + date.setDate( daysOfYear ); + } + if ( hour12 && amPm === "pm" ) { date.setHours( date.getHours() + 12 ); } + if ( timezoneOffset ) { + date.setMinutes( date.getMinutes() + timezoneOffset ); + } + // Truncate date at the most precise unit defined. Eg. // If value is "12/31", and pattern is "MM/dd": // => new Date( , 12, 31, 0, 0, 0, 0 ); @@ -963,7 +1138,7 @@ return function( value, tokens, properties ) { return date; }; -}()); + /** @@ -982,6 +1157,19 @@ var dateParseProperties = function( cldr ) { +/** + * Generated by: + * + * regenerate().add( require( "unicode-7.0.0/categories/N/symbols" ) ).toString(); + * + * https://github.com/mathiasbynens/regenerate + * https://github.com/mathiasbynens/unicode-7.0.0 + */ +var regexpN = /[0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D66-\u0D75\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]|\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDD16-\uDD1B\uDE40-\uDE47\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDE60-\uDE7E]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9]|\uD806[\uDCE0-\uDCF2]|\uD809[\uDC00-\uDC6E]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59\uDF5B-\uDF61]|\uD834[\uDF60-\uDF71]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDCC7-\uDCCF]|\uD83C[\uDD00-\uDD0C]/; + + + + /** * tokenizer( value, pattern, properties ) * @@ -1013,30 +1201,100 @@ var dateParseProperties = function( cldr ) { * * Return an empty Array when not successfully parsed. */ -var dateTokenizer = function( value, properties ) { +var dateTokenizer = function( value, numberParser, properties ) { var valid, + timeSeparator = properties.timeSeparator, tokens = [], widths = [ "abbreviated", "wide", "narrow" ]; valid = properties.pattern.match( datePatternRe ).every(function( current ) { - var chr, length, tokenRe, + var chr, length, numeric, tokenRe, token = {}; + function hourFormatParse( tokenRe, numberParser ) { + var aux = value.match( tokenRe ); + numberParser = numberParser || function( value ) { + return +value; + }; + + if ( !aux ) { + return false; + } + + // hourFormat containing H only, e.g., `+H;-H` + if ( aux.length < 8 ) { + token.value = + ( aux[ 1 ] ? -numberParser( aux[ 1 ] ) : numberParser( aux[ 4 ] ) ) * 60; + + // hourFormat containing H and m, e.g., `+HHmm;-HHmm` + } else { + token.value = + ( aux[ 1 ] ? -numberParser( aux[ 1 ] ) : numberParser( aux[ 7 ] ) ) * 60 + + ( aux[ 1 ] ? -numberParser( aux[ 4 ] ) : numberParser( aux[ 10 ] ) ); + } + + return true; + } + + // Transform: + // - "+H;-H" -> /\+(\d\d?)|-(\d\d?)/ + // - "+HH;-HH" -> /\+(\d\d)|-(\d\d)/ + // - "+HHmm;-HHmm" -> /\+(\d\d)(\d\d)|-(\d\d)(\d\d)/ + // - "+HH:mm;-HH:mm" -> /\+(\d\d):(\d\d)|-(\d\d):(\d\d)/ + // + // If gmtFormat is GMT{0}, the regexp must fill {0} in each side, e.g.: + // - "+H;-H" -> /GMT\+(\d\d?)|GMT-(\d\d?)/ + function hourFormatRe( hourFormat, gmtFormat, timeSeparator ) { + var re; + + if ( !gmtFormat ) { + gmtFormat = "{0}"; + } + + re = hourFormat + .replace( "+", "\\+" ) + + // Unicode equivalent to (\\d\\d) + .replace( /HH|mm/g, "((" + regexpN.source + ")(" + regexpN.source + "))" ) + + // Unicode equivalent to (\\d\\d?) + .replace( /H|m/g, "((" + regexpN.source + ")(" + regexpN.source + ")?)" ); + + if ( timeSeparator ) { + re = re.replace( /:/g, timeSeparator ); + } + + re = re.split( ";" ).map(function( part ) { + return gmtFormat.replace( "{0}", part ); + }).join( "|" ); + + return new RegExp( re ); + } + function oneDigitIfLengthOne() { if ( length === 1 ) { - return tokenRe = /\d/; + + // Unicode equivalent to /\d/ + numeric = true; + return tokenRe = regexpN; } } function oneOrTwoDigitsIfLengthOne() { if ( length === 1 ) { - return tokenRe = /\d\d?/; + + // Unicode equivalent to /\d\d?/ + numeric = true; + return tokenRe = new RegExp( "(" + regexpN.source + ")(" + regexpN.source + ")?" ); } } function twoDigitsIfLengthTwo() { if ( length === 2 ) { - return tokenRe = /\d\d/; + + // Unicode equivalent to /\d\d/ + numeric = true; + return tokenRe = new RegExp( "(" + regexpN.source + ")(" + regexpN.source + ")" ); } } @@ -1044,7 +1302,7 @@ var dateTokenizer = function( value, properties ) { // Return the first found one (and set token accordingly), or null. function lookup( path ) { var i, re, - data = properties[ path.join( "/" ).replace( /^.*calendars\//, "" ) ]; + data = properties[ path.join( "/" ) ]; for ( i in data ) { re = new RegExp( "^" + data[ i ] ); @@ -1060,12 +1318,30 @@ var dateTokenizer = function( value, properties ) { chr = current.charAt( 0 ), length = current.length; + if ( chr === "Z" ) { + // Z..ZZZ: same as "xxxx". + if ( length < 4 ) { + chr = "x"; + length = 4; + + // ZZZZ: same as "OOOO". + } else if ( length < 5 ) { + chr = "O"; + length = 4; + + // ZZZZZ: same as "XXXXX" + } else { + chr = "X"; + length = 5; + } + } + switch ( chr ) { // Era case "G": lookup([ - "dates/calendars/gregorian/eras", + "gregorian/eras", length <= 3 ? "eraAbbr" : ( length === 4 ? "eraNames" : "eraNarrow" ) ]); break; @@ -1073,27 +1349,31 @@ var dateTokenizer = function( value, properties ) { // Year case "y": case "Y": + numeric = true; + // number l=1:+, l=2:{2}, l=3:{3,}, l=4:{4,}, ... if ( length === 1 ) { - tokenRe = /\d+/; + + // Unicode equivalent to /\d+/. + tokenRe = new RegExp( "(" + regexpN.source + ")+" ); } else if ( length === 2 ) { - tokenRe = /\d\d/; + + // Unicode equivalent to /\d\d/ + tokenRe = new RegExp( "(" + regexpN.source + ")(" + regexpN.source + ")" ); } else { - tokenRe = new RegExp( "\\d{" + length + ",}" ); + + // Unicode equivalent to /\d{length,}/ + tokenRe = new RegExp( "(" + regexpN.source + "){" + length + ",}" ); } break; - case "u": // Extended year. Need to be implemented. - case "U": // Cyclic year name. Need to be implemented. - throw new Error( "Not implemented" ); - // Quarter case "Q": case "q": // number l=1:{1}, l=2:{2}. // lookup l=3... oneDigitIfLengthOne() || twoDigitsIfLengthTwo() || lookup([ - "dates/calendars/gregorian/quarters", + "gregorian/quarters", chr === "Q" ? "format" : "stand-alone", widths[ length - 3 ] ]); @@ -1105,17 +1385,20 @@ var dateTokenizer = function( value, properties ) { // number l=1:{1,2}, l=2:{2}. // lookup l=3... oneOrTwoDigitsIfLengthOne() || twoDigitsIfLengthTwo() || lookup([ - "dates/calendars/gregorian/months", + "gregorian/months", chr === "M" ? "format" : "stand-alone", widths[ length - 3 ] ]); break; - // Day (see d below) + // Day case "D": // number {l,3}. if ( length <= 3 ) { - tokenRe = new RegExp( "\\d{" + length + ",3}" ); + + // Unicode equivalent to /\d{length,3}/ + numeric = true; + tokenRe = new RegExp( "(" + regexpN.source + "){" + length + ",3}" ); } break; @@ -1125,10 +1408,6 @@ var dateTokenizer = function( value, properties ) { oneDigitIfLengthOne(); break; - case "g+": - // Modified Julian day. Need to be implemented. - throw new Error( "Not implemented" ); - // Week day case "e": case "c": @@ -1145,17 +1424,17 @@ var dateTokenizer = function( value, properties ) { // Note: if short day names are not explicitly specified, abbreviated day // names are used instead http://www.unicode.org/reports/tr35/tr35-dates.html#months_days_quarters_eras lookup([ - "dates/calendars/gregorian/days", + "gregorian/days", [ chr === "c" ? "stand-alone" : "format" ], "short" ]) || lookup([ - "dates/calendars/gregorian/days", + "gregorian/days", [ chr === "c" ? "stand-alone" : "format" ], "abbreviated" ]); } else { lookup([ - "dates/calendars/gregorian/days", + "gregorian/days", [ chr === "c" ? "stand-alone" : "format" ], widths[ length < 3 ? 0 : length - 3 ] ]); @@ -1165,7 +1444,7 @@ var dateTokenizer = function( value, properties ) { // Period (AM or PM) case "a": lookup([ - "dates/calendars/gregorian/dayPeriods/format/wide" + "gregorian/dayPeriods/format/wide" ]); break; @@ -1185,33 +1464,68 @@ var dateTokenizer = function( value, properties ) { case "S": // number {l}. - tokenRe = new RegExp( "\\d{" + length + "}" ); + + // Unicode equivalent to /\d{length}/ + numeric = true; + tokenRe = new RegExp( "(" + regexpN.source + "){" + length + "}" ); break; case "A": // number {l+5}. - tokenRe = new RegExp( "\\d{" + ( length + 5 ) + "}" ); + + // Unicode equivalent to /\d{length+5}/ + numeric = true; + tokenRe = new RegExp( "(" + regexpN.source + "){" + ( length + 5 ) + "}" ); break; // Zone - // see http://www.unicode.org/reports/tr35/tr35-dates.html#Using_Time_Zone_Names ? - // Need to be implemented. case "z": - case "Z": case "O": - case "v": - case "V": + // O: "{gmtFormat}+H;{gmtFormat}-H" or "{gmtZeroFormat}", eg. "GMT-8" or "GMT". + // OOOO: "{gmtFormat}{hourFormat}" or "{gmtZeroFormat}", eg. "GMT-08:00" or "GMT". + if ( value === properties[ "timeZoneNames/gmtZeroFormat" ] ) { + token.value = 0; + tokenRe = new RegExp( properties[ "timeZoneNames/gmtZeroFormat" ] ); + } else { + tokenRe = hourFormatRe( + length < 4 ? "+H;-H" : properties[ "timeZoneNames/hourFormat" ], + properties[ "timeZoneNames/gmtFormat" ], + timeSeparator + ); + if ( !hourFormatParse( tokenRe, numberParser ) ) { + return null; + } + } + break; + case "X": + // Same as x*, except it uses "Z" for zero offset. + if ( value === "Z" ) { + token.value = 0; + tokenRe = /Z/; + break; + } + + /* falls through */ case "x": - throw new Error( "Not implemented" ); + // x: hourFormat("+HH;-HH") + // xx or xxxx: hourFormat("+HHmm;-HHmm") + // xxx or xxxxx: hourFormat("+HH:mm;-HH:mm") + tokenRe = hourFormatRe( + length === 1 ? "+HH;-HH" : ( length % 2 ? "+HH:mm;-HH:mm" : "+HHmm;-HHmm" ) + ); + if ( !hourFormatParse( tokenRe ) ) { + return null; + } + break; case "'": token.type = "literal"; - if ( current.charAt( 1 ) === "'" ) { - tokenRe = /'/; - } else { - tokenRe = /'[^']+'/; + current = current.replace( /''/, "'" ); + if ( length > 2 ) { + current = current.slice( 1, -1 ); } + tokenRe = new RegExp( regexpEscape( current ) ); break; default: @@ -1226,6 +1540,9 @@ var dateTokenizer = function( value, properties ) { // Get lexeme and consume it. value = value.replace( new RegExp( "^" + tokenRe.source ), function( lexeme ) { token.lexeme = lexeme; + if ( numeric ) { + token.value = numberParser( lexeme ); + } return ""; }); @@ -1254,12 +1571,15 @@ var dateTokenizer = function( value, properties ) { */ var dateTokenizerProperties = function( pattern, cldr ) { var properties = { - pattern: pattern + pattern: pattern, + timeSeparator: numberSymbol( "timeSeparator", cldr ) }, widths = [ "abbreviated", "wide", "narrow" ]; function populateProperties( path, value ) { - properties[ path.replace( /^.*calendars\//, "" ) ] = value; + + // The `dates` and `calendars` trim's purpose is to reduce properties' key size only. + properties[ path.replace( /^.*\/dates\//, "" ).replace( /calendars\//, "" ) ] = value; } cldr.on( "get", populateProperties ); @@ -1270,6 +1590,11 @@ var dateTokenizerProperties = function( pattern, cldr ) { chr = current.charAt( 0 ), length = current.length; + if ( chr === "Z" && length < 5 ) { + chr = "O"; + length = 4; + } + switch ( chr ) { // Era @@ -1280,6 +1605,13 @@ var dateTokenizerProperties = function( pattern, cldr ) { ]); break; + // Year + case "u": // Extended year. Need to be implemented. + case "U": // Cyclic year name. Need to be implemented. + throw createErrorUnsupportedFeature({ + feature: "year pattern `" + chr + "`" + }); + // Quarter case "Q": case "q": @@ -1306,6 +1638,13 @@ var dateTokenizerProperties = function( pattern, cldr ) { } break; + // Day + case "g": + // Modified Julian day. Need to be implemented. + throw createErrorUnsupportedFeature({ + feature: "Julian day pattern `g`" + }); + // Week day case "e": case "c": @@ -1343,6 +1682,20 @@ var dateTokenizerProperties = function( pattern, cldr ) { "dates/calendars/gregorian/dayPeriods/format/wide" ]); break; + + // Zone + case "z": + case "O": + cldr.main( "dates/timeZoneNames/gmtFormat" ); + cldr.main( "dates/timeZoneNames/gmtZeroFormat" ); + cldr.main( "dates/timeZoneNames/hourFormat" ); + break; + + case "v": + case "V": + throw createErrorUnsupportedFeature({ + feature: "timezone pattern `" + chr + "`" + }); } }); @@ -1357,6 +1710,7 @@ var dateTokenizerProperties = function( pattern, cldr ) { function validateRequiredCldr( path, value ) { validateCldr( path, value, { skip: [ + /dates\/calendars\/gregorian\/dateTimeFormats\/availableFormats/, /dates\/calendars\/gregorian\/days\/.*\/short/, /supplemental\/timeData\/(?!001)/, /supplemental\/weekData\/(?!001)/ @@ -1365,11 +1719,11 @@ function validateRequiredCldr( path, value ) { } /** - * .dateFormatter( pattern ) + * .dateFormatter( options ) * - * @pattern [String or Object] see date/expand_pattern for more info. + * @options [Object] see date/expand_pattern for more info. * - * Return a date formatter function (of the form below) according to the given pattern and the + * Return a date formatter function (of the form below) according to the given options and the * default/instance locale. * * fn( value ) @@ -1380,96 +1734,107 @@ function validateRequiredCldr( path, value ) { * locale. */ Globalize.dateFormatter = -Globalize.prototype.dateFormatter = function( pattern ) { - var cldr, properties; +Globalize.prototype.dateFormatter = function( options ) { + var cldr, numberFormatters, pad, pattern, properties; - validateParameterPresence( pattern, "pattern" ); - validateParameterTypeDatePattern( pattern, "pattern" ); + validateParameterTypePlainObject( options, "options" ); cldr = this.cldr; + options = options || { skeleton: "yMd" }; validateDefaultLocale( cldr ); cldr.on( "get", validateRequiredCldr ); - pattern = dateExpandPattern( pattern, cldr ); + pattern = dateExpandPattern( options, cldr ); properties = dateFormatProperties( pattern, cldr ); cldr.off( "get", validateRequiredCldr ); + // Create needed number formatters. + numberFormatters = properties.numberFormatters; + delete properties.numberFormatters; + for ( pad in numberFormatters ) { + numberFormatters[ pad ] = this.numberFormatter({ + raw: numberFormatters[ pad ] + }); + } + return function( value ) { validateParameterPresence( value, "value" ); validateParameterTypeDate( value, "value" ); - return dateFormat( value, properties ); + return dateFormat( value, numberFormatters, properties ); }; }; /** - * .dateParser( pattern ) + * .dateParser( options ) * - * @pattern [String or Object] see date/expand_pattern for more info. + * @options [Object] see date/expand_pattern for more info. * * Return a function that parses a string date according to the given `formats` and the * default/instance locale. */ Globalize.dateParser = -Globalize.prototype.dateParser = function( pattern ) { - var cldr, parseProperties, tokenizerProperties; +Globalize.prototype.dateParser = function( options ) { + var cldr, numberParser, parseProperties, pattern, tokenizerProperties; - validateParameterPresence( pattern, "pattern" ); - validateParameterTypeDatePattern( pattern, "pattern" ); + validateParameterTypePlainObject( options, "options" ); cldr = this.cldr; + options = options || { skeleton: "yMd" }; validateDefaultLocale( cldr ); cldr.on( "get", validateRequiredCldr ); - pattern = dateExpandPattern( pattern, cldr ); + pattern = dateExpandPattern( options, cldr ); tokenizerProperties = dateTokenizerProperties( pattern, cldr ); parseProperties = dateParseProperties( cldr ); cldr.off( "get", validateRequiredCldr ); + numberParser = this.numberParser({ raw: "0" }); + return function( value ) { var tokens; validateParameterPresence( value, "value" ); validateParameterTypeString( value, "value" ); - tokens = dateTokenizer( value, tokenizerProperties ); + tokens = dateTokenizer( value, numberParser, tokenizerProperties ); return dateParse( value, tokens, parseProperties ) || null; }; }; /** - * .formatDate( value, pattern ) + * .formatDate( value, options ) * * @value [Date] * - * @pattern [String or Object] see date/expand_pattern for more info. + * @options [Object] see date/expand_pattern for more info. * - * Formats a date or number according to the given pattern string and the default/instance locale. + * Formats a date or number according to the given options string and the default/instance locale. */ Globalize.formatDate = -Globalize.prototype.formatDate = function( value, pattern ) { +Globalize.prototype.formatDate = function( value, options ) { validateParameterPresence( value, "value" ); validateParameterTypeDate( value, "value" ); - return this.dateFormatter( pattern )( value ); + return this.dateFormatter( options )( value ); }; /** - * .parseDate( value, pattern ) + * .parseDate( value, options ) * * @value [String] * - * @pattern [String or Object] see date/expand_pattern for more info. + * @options [Object] see date/expand_pattern for more info. * * Return a Date instance or null. */ Globalize.parseDate = -Globalize.prototype.parseDate = function( value, pattern ) { +Globalize.prototype.parseDate = function( value, options ) { validateParameterPresence( value, "value" ); validateParameterTypeString( value, "value" ); - return this.dateParser( pattern )( value ); + return this.dateParser( options )( value ); }; return Globalize; diff --git a/external/globalize/globalize/number.js b/external/globalize/globalize/number.js new file mode 100644 index 000000000..7ab4256d4 --- /dev/null +++ b/external/globalize/globalize/number.js @@ -0,0 +1,1266 @@ +/** + * Globalize v1.0.0 + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2015-04-23T12:02Z + */ +/*! + * Globalize v1.0.0 2015-04-23T12:02Z Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "cldr", + "../globalize", + "cldr/event", + "cldr/supplemental" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "cldrjs" ), require( "globalize" ) ); + } else { + + // Global + factory( root.Cldr, root.Globalize ); + } +}(this, function( Cldr, Globalize ) { + +var createError = Globalize._createError, + objectExtend = Globalize._objectExtend, + regexpEscape = Globalize._regexpEscape, + stringPad = Globalize._stringPad, + validateCldr = Globalize._validateCldr, + validateDefaultLocale = Globalize._validateDefaultLocale, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterRange = Globalize._validateParameterRange, + validateParameterType = Globalize._validateParameterType, + validateParameterTypePlainObject = Globalize._validateParameterTypePlainObject; + + +var createErrorUnsupportedFeature = function( feature ) { + return createError( "E_UNSUPPORTED", "Unsupported {feature}.", { + feature: feature + }); +}; + + + + +var validateParameterTypeNumber = function( value, name ) { + validateParameterType( + value, + name, + value === undefined || typeof value === "number", + "Number" + ); +}; + + + + +var validateParameterTypeString = function( value, name ) { + validateParameterType( + value, + name, + value === undefined || typeof value === "string", + "a string" + ); +}; + + + + +/** + * goupingSeparator( number, primaryGroupingSize, secondaryGroupingSize ) + * + * @number [Number]. + * + * @primaryGroupingSize [Number] + * + * @secondaryGroupingSize [Number] + * + * Return the formatted number with group separator. + */ +var numberFormatGroupingSeparator = function( number, primaryGroupingSize, secondaryGroupingSize ) { + var index, + currentGroupingSize = primaryGroupingSize, + ret = "", + sep = ",", + switchToSecondary = secondaryGroupingSize ? true : false; + + number = String( number ).split( "." ); + index = number[ 0 ].length; + + while ( index > currentGroupingSize ) { + ret = number[ 0 ].slice( index - currentGroupingSize, index ) + + ( ret.length ? sep : "" ) + ret; + index -= currentGroupingSize; + if ( switchToSecondary ) { + currentGroupingSize = secondaryGroupingSize; + switchToSecondary = false; + } + } + + number[ 0 ] = number[ 0 ].slice( 0, index ) + ( ret.length ? sep : "" ) + ret; + return number.join( "." ); +}; + + + + +/** + * integerFractionDigits( number, minimumIntegerDigits, minimumFractionDigits, + * maximumFractionDigits, round, roundIncrement ) + * + * @number [Number] + * + * @minimumIntegerDigits [Number] + * + * @minimumFractionDigits [Number] + * + * @maximumFractionDigits [Number] + * + * @round [Function] + * + * @roundIncrement [Function] + * + * Return the formatted integer and fraction digits. + */ +var numberFormatIntegerFractionDigits = function( number, minimumIntegerDigits, minimumFractionDigits, maximumFractionDigits, round, + roundIncrement ) { + + // Fraction + if ( maximumFractionDigits ) { + + // Rounding + if ( roundIncrement ) { + number = round( number, roundIncrement ); + + // Maximum fraction digits + } else { + number = round( number, { exponent: -maximumFractionDigits } ); + } + + // Minimum fraction digits + if ( minimumFractionDigits ) { + number = String( number ).split( "." ); + number[ 1 ] = stringPad( number[ 1 ] || "", minimumFractionDigits, true ); + number = number.join( "." ); + } + } else { + number = round( number ); + } + + number = String( number ); + + // Minimum integer digits + if ( minimumIntegerDigits ) { + number = number.split( "." ); + number[ 0 ] = stringPad( number[ 0 ], minimumIntegerDigits ); + number = number.join( "." ); + } + + return number; +}; + + + + +/** + * toPrecision( number, precision, round ) + * + * @number (Number) + * + * @precision (Number) significant figures precision (not decimal precision). + * + * @round (Function) + * + * Return number.toPrecision( precision ) using the given round function. + */ +var numberToPrecision = function( number, precision, round ) { + var roundOrder; + + // Get number at two extra significant figure precision. + number = number.toPrecision( precision + 2 ); + + // Then, round it to the required significant figure precision. + roundOrder = Math.ceil( Math.log( Math.abs( number ) ) / Math.log( 10 ) ); + roundOrder -= precision; + + return round( number, { exponent: roundOrder } ); +}; + + + + +/** + * toPrecision( number, minimumSignificantDigits, maximumSignificantDigits, round ) + * + * @number [Number] + * + * @minimumSignificantDigits [Number] + * + * @maximumSignificantDigits [Number] + * + * @round [Function] + * + * Return the formatted significant digits number. + */ +var numberFormatSignificantDigits = function( number, minimumSignificantDigits, maximumSignificantDigits, round ) { + var atMinimum, atMaximum; + + // Sanity check. + if ( minimumSignificantDigits > maximumSignificantDigits ) { + maximumSignificantDigits = minimumSignificantDigits; + } + + atMinimum = numberToPrecision( number, minimumSignificantDigits, round ); + atMaximum = numberToPrecision( number, maximumSignificantDigits, round ); + + // Use atMaximum only if it has more significant digits than atMinimum. + number = +atMinimum === +atMaximum ? atMinimum : atMaximum; + + // Expand integer numbers, eg. 123e5 to 12300. + number = ( +number ).toString( 10 ); + + if ( (/e/).test( number ) ) { + throw createErrorUnsupportedFeature({ + feature: "integers out of (1e21, 1e-7)" + }); + } + + // Add trailing zeros if necessary. + if ( minimumSignificantDigits - number.replace( /^0+|\./g, "" ).length > 0 ) { + number = number.split( "." ); + number[ 1 ] = stringPad( number[ 1 ] || "", minimumSignificantDigits - number[ 0 ].replace( /^0+/, "" ).length, true ); + number = number.join( "." ); + } + + return number; +}; + + + + +/** + * format( number, properties ) + * + * @number [Number]. + * + * @properties [Object] Output of number/format-properties. + * + * Return the formatted number. + * ref: http://www.unicode.org/reports/tr35/tr35-numbers.html + */ +var numberFormat = function( number, properties ) { + var infinitySymbol, maximumFractionDigits, maximumSignificantDigits, minimumFractionDigits, + minimumIntegerDigits, minimumSignificantDigits, nanSymbol, nuDigitsMap, padding, prefix, + primaryGroupingSize, pattern, ret, round, roundIncrement, secondaryGroupingSize, suffix, + symbolMap; + + padding = properties[ 1 ]; + minimumIntegerDigits = properties[ 2 ]; + minimumFractionDigits = properties[ 3 ]; + maximumFractionDigits = properties[ 4 ]; + minimumSignificantDigits = properties[ 5 ]; + maximumSignificantDigits = properties[ 6 ]; + roundIncrement = properties[ 7 ]; + primaryGroupingSize = properties[ 8 ]; + secondaryGroupingSize = properties[ 9 ]; + round = properties[ 15 ]; + infinitySymbol = properties[ 16 ]; + nanSymbol = properties[ 17 ]; + symbolMap = properties[ 18 ]; + nuDigitsMap = properties[ 19 ]; + + // NaN + if ( isNaN( number ) ) { + return nanSymbol; + } + + if ( number < 0 ) { + pattern = properties[ 12 ]; + prefix = properties[ 13 ]; + suffix = properties[ 14 ]; + } else { + pattern = properties[ 11 ]; + prefix = properties[ 0 ]; + suffix = properties[ 10 ]; + } + + // Infinity + if ( !isFinite( number ) ) { + return prefix + infinitySymbol + suffix; + } + + ret = prefix; + + // Percent + if ( pattern.indexOf( "%" ) !== -1 ) { + number *= 100; + + // Per mille + } else if ( pattern.indexOf( "\u2030" ) !== -1 ) { + number *= 1000; + } + + // Significant digit format + if ( !isNaN( minimumSignificantDigits * maximumSignificantDigits ) ) { + number = numberFormatSignificantDigits( number, minimumSignificantDigits, + maximumSignificantDigits, round ); + + // Integer and fractional format + } else { + number = numberFormatIntegerFractionDigits( number, minimumIntegerDigits, + minimumFractionDigits, maximumFractionDigits, round, roundIncrement ); + } + + // Remove the possible number minus sign + number = number.replace( /^-/, "" ); + + // Grouping separators + if ( primaryGroupingSize ) { + number = numberFormatGroupingSeparator( number, primaryGroupingSize, + secondaryGroupingSize ); + } + + ret += number; + + // Scientific notation + // TODO implement here + + // Padding/'([^']|'')+'|''|[.,\-+E%\u2030]/g + // TODO implement here + + ret += suffix; + + return ret.replace( /('([^']|'')+'|'')|./g, function( character, literal ) { + + // Literals + if ( literal ) { + literal = literal.replace( /''/, "'" ); + if ( literal.length > 2 ) { + literal = literal.slice( 1, -1 ); + } + return literal; + } + + // Symbols + character = character.replace( /[.,\-+E%\u2030]/, function( symbol ) { + return symbolMap[ symbol ]; + }); + + // Numbering system + if ( nuDigitsMap ) { + character = character.replace( /[0-9]/, function( digit ) { + return nuDigitsMap[ +digit ]; + }); + } + + return character; + }); +}; + + + + +/** + * NumberingSystem( cldr ) + * + * - http://www.unicode.org/reports/tr35/tr35-numbers.html#otherNumberingSystems + * - http://cldr.unicode.org/index/bcp47-extension + * - http://www.unicode.org/reports/tr35/#u_Extension + */ +var numberNumberingSystem = function( cldr ) { + var nu = cldr.attributes[ "u-nu" ]; + + if ( nu ) { + if ( nu === "traditio" ) { + nu = "traditional"; + } + if ( [ "native", "traditional", "finance" ].indexOf( nu ) !== -1 ) { + + // Unicode locale extension `u-nu` is set using either (native, traditional or + // finance). So, lookup the respective locale's numberingSystem and return it. + return cldr.main([ "numbers/otherNumberingSystems", nu ]); + } + + // Unicode locale extension `u-nu` is set with an explicit numberingSystem. Return it. + return nu; + } + + // Return the default numberingSystem. + return cldr.main( "numbers/defaultNumberingSystem" ); +}; + + + + +/** + * nuMap( cldr ) + * + * @cldr [Cldr instance]. + * + * Return digits map if numbering system is different than `latn`. + */ +var numberNumberingSystemDigitsMap = function( cldr ) { + var aux, + nu = numberNumberingSystem( cldr ); + + if ( nu === "latn" ) { + return; + } + + aux = cldr.supplemental([ "numberingSystems", nu ]); + + if ( aux._type !== "numeric" ) { + throw createErrorUnsupportedFeature( "`" + aux._type + "` numbering system" ); + } + + return aux._digits; +}; + + + + +/** + * EBNF representation: + * + * number_pattern_re = prefix? + * padding? + * (integer_fraction_pattern | significant_pattern) + * scientific_notation? + * suffix? + * + * prefix = non_number_stuff + * + * padding = "*" regexp(.) + * + * integer_fraction_pattern = integer_pattern + * fraction_pattern? + * + * integer_pattern = regexp([#,]*[0,]*0+) + * + * fraction_pattern = "." regexp(0*[0-9]*#*) + * + * significant_pattern = regexp([#,]*@+#*) + * + * scientific_notation = regexp(E\+?0+) + * + * suffix = non_number_stuff + * + * non_number_stuff = regexp(('[^']+'|''|[^*#@0,.E])*) + * + * + * Regexp groups: + * + * 0: number_pattern_re + * 1: prefix + * 2: - + * 3: padding + * 4: (integer_fraction_pattern | significant_pattern) + * 5: integer_fraction_pattern + * 6: integer_pattern + * 7: fraction_pattern + * 8: significant_pattern + * 9: scientific_notation + * 10: suffix + * 11: - + */ +var numberPatternRe = (/^(('[^']+'|''|[^*#@0,.E])*)(\*.)?((([#,]*[0,]*0+)(\.0*[0-9]*#*)?)|([#,]*@+#*))(E\+?0+)?(('[^']+'|''|[^*#@0,.E])*)$/); + + + + +/** + * format( number, pattern ) + * + * @number [Number]. + * + * @pattern [String] raw pattern for numbers. + * + * Return the formatted number. + * ref: http://www.unicode.org/reports/tr35/tr35-numbers.html + */ +var numberPatternProperties = function( pattern ) { + var aux1, aux2, fractionPattern, integerFractionOrSignificantPattern, integerPattern, + maximumFractionDigits, maximumSignificantDigits, minimumFractionDigits, + minimumIntegerDigits, minimumSignificantDigits, padding, prefix, primaryGroupingSize, + roundIncrement, scientificNotation, secondaryGroupingSize, significantPattern, suffix; + + pattern = pattern.match( numberPatternRe ); + if ( !pattern ) { + throw new Error( "Invalid pattern: " + pattern ); + } + + prefix = pattern[ 1 ]; + padding = pattern[ 3 ]; + integerFractionOrSignificantPattern = pattern[ 4 ]; + significantPattern = pattern[ 8 ]; + scientificNotation = pattern[ 9 ]; + suffix = pattern[ 10 ]; + + // Significant digit format + if ( significantPattern ) { + significantPattern.replace( /(@+)(#*)/, function( match, minimumSignificantDigitsMatch, maximumSignificantDigitsMatch ) { + minimumSignificantDigits = minimumSignificantDigitsMatch.length; + maximumSignificantDigits = minimumSignificantDigits + + maximumSignificantDigitsMatch.length; + }); + + // Integer and fractional format + } else { + fractionPattern = pattern[ 7 ]; + integerPattern = pattern[ 6 ]; + + if ( fractionPattern ) { + + // Minimum fraction digits, and rounding. + fractionPattern.replace( /[0-9]+/, function( match ) { + minimumFractionDigits = match; + }); + if ( minimumFractionDigits ) { + roundIncrement = +( "0." + minimumFractionDigits ); + minimumFractionDigits = minimumFractionDigits.length; + } else { + minimumFractionDigits = 0; + } + + // Maximum fraction digits + // 1: ignore decimal character + maximumFractionDigits = fractionPattern.length - 1 /* 1 */; + } + + // Minimum integer digits + integerPattern.replace( /0+$/, function( match ) { + minimumIntegerDigits = match.length; + }); + } + + // Scientific notation + if ( scientificNotation ) { + throw createErrorUnsupportedFeature({ + feature: "scientific notation (not implemented)" + }); + } + + // Padding + if ( padding ) { + throw createErrorUnsupportedFeature({ + feature: "padding (not implemented)" + }); + } + + // Grouping + if ( ( aux1 = integerFractionOrSignificantPattern.lastIndexOf( "," ) ) !== -1 ) { + + // Primary grouping size is the interval between the last group separator and the end of + // the integer (or the end of the significant pattern). + aux2 = integerFractionOrSignificantPattern.split( "." )[ 0 ]; + primaryGroupingSize = aux2.length - aux1 - 1; + + // Secondary grouping size is the interval between the last two group separators. + if ( ( aux2 = integerFractionOrSignificantPattern.lastIndexOf( ",", aux1 - 1 ) ) !== -1 ) { + secondaryGroupingSize = aux1 - 1 - aux2; + } + } + + // Return: + // 0: @prefix String + // 1: @padding Array [ , ] TODO + // 2: @minimumIntegerDigits non-negative integer Number value indicating the minimum integer + // digits to be used. Numbers will be padded with leading zeroes if necessary. + // 3: @minimumFractionDigits and + // 4: @maximumFractionDigits are non-negative integer Number values indicating the minimum and + // maximum fraction digits to be used. Numbers will be rounded or padded with trailing + // zeroes if necessary. + // 5: @minimumSignificantDigits and + // 6: @maximumSignificantDigits are positive integer Number values indicating the minimum and + // maximum fraction digits to be shown. Either none or both of these properties are + // present; if they are, they override minimum and maximum integer and fraction digits + // – the formatter uses however many integer and fraction digits are required to display + // the specified number of significant digits. + // 7: @roundIncrement Decimal round increment or null + // 8: @primaryGroupingSize + // 9: @secondaryGroupingSize + // 10: @suffix String + return [ + prefix, + padding, + minimumIntegerDigits, + minimumFractionDigits, + maximumFractionDigits, + minimumSignificantDigits, + maximumSignificantDigits, + roundIncrement, + primaryGroupingSize, + secondaryGroupingSize, + suffix + ]; +}; + + + + +/** + * Symbol( name, cldr ) + * + * @name [String] Symbol name. + * + * @cldr [Cldr instance]. + * + * Return the localized symbol given its name. + */ +var numberSymbol = function( name, cldr ) { + return cldr.main([ + "numbers/symbols-numberSystem-" + numberNumberingSystem( cldr ), + name + ]); +}; + + + + +var numberSymbolName = { + ".": "decimal", + ",": "group", + "%": "percentSign", + "+": "plusSign", + "-": "minusSign", + "E": "exponential", + "\u2030": "perMille" +}; + + + + +/** + * symbolMap( cldr ) + * + * @cldr [Cldr instance]. + * + * Return the (localized symbol, pattern symbol) key value pair, eg. { + * ".": "٫", + * ",": "٬", + * "%": "٪", + * ... + * }; + */ +var numberSymbolMap = function( cldr ) { + var symbol, + symbolMap = {}; + + for ( symbol in numberSymbolName ) { + symbolMap[ symbol ] = numberSymbol( numberSymbolName[ symbol ], cldr ); + } + + return symbolMap; +}; + + + + +var numberTruncate = function( value ) { + if ( isNaN( value ) ) { + return NaN; + } + return Math[ value < 0 ? "ceil" : "floor" ]( value ); +}; + + + + +/** + * round( method ) + * + * @method [String] with either "round", "ceil", "floor", or "truncate". + * + * Return function( value, incrementOrExp ): + * + * @value [Number] eg. 123.45. + * + * @incrementOrExp [Number] optional, eg. 0.1; or + * [Object] Either { increment: } or { exponent: } + * + * Return the rounded number, eg: + * - round( "round" )( 123.45 ): 123; + * - round( "ceil" )( 123.45 ): 124; + * - round( "floor" )( 123.45 ): 123; + * - round( "truncate" )( 123.45 ): 123; + * - round( "round" )( 123.45, 0.1 ): 123.5; + * - round( "round" )( 123.45, 10 ): 120; + * + * Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round + * Ref: #376 + */ +var numberRound = function( method ) { + method = method || "round"; + method = method === "truncate" ? numberTruncate : Math[ method ]; + + return function( value, incrementOrExp ) { + var exp, increment; + + value = +value; + + // If the value is not a number, return NaN. + if ( isNaN( value ) ) { + return NaN; + } + + // Exponent given. + if ( typeof incrementOrExp === "object" && incrementOrExp.exponent ) { + exp = +incrementOrExp.exponent; + increment = 1; + + if ( exp === 0 ) { + return method( value ); + } + + // If the exp is not an integer, return NaN. + if ( !( typeof exp === "number" && exp % 1 === 0 ) ) { + return NaN; + } + + // Increment given. + } else { + increment = +incrementOrExp || 1; + + if ( increment === 1 ) { + return method( value ); + } + + // If the increment is not a number, return NaN. + if ( isNaN( increment ) ) { + return NaN; + } + + increment = increment.toExponential().split( "e" ); + exp = +increment[ 1 ]; + increment = +increment[ 0 ]; + } + + // Shift & Round + value = value.toString().split( "e" ); + value[ 0 ] = +value[ 0 ] / increment; + value[ 1 ] = value[ 1 ] ? ( +value[ 1 ] - exp ) : -exp; + value = method( +(value[ 0 ] + "e" + value[ 1 ] ) ); + + // Shift back + value = value.toString().split( "e" ); + value[ 0 ] = +value[ 0 ] * increment; + value[ 1 ] = value[ 1 ] ? ( +value[ 1 ] + exp ) : exp; + return +( value[ 0 ] + "e" + value[ 1 ] ); + }; +}; + + + + +/** + * formatProperties( pattern, cldr [, options] ) + * + * @pattern [String] raw pattern for numbers. + * + * @cldr [Cldr instance]. + * + * @options [Object]: + * - minimumIntegerDigits [Number] + * - minimumFractionDigits, maximumFractionDigits [Number] + * - minimumSignificantDigits, maximumSignificantDigits [Number] + * - round [String] "ceil", "floor", "round" (default), or "truncate". + * - useGrouping [Boolean] default true. + * + * Return the processed properties that will be used in number/format. + * ref: http://www.unicode.org/reports/tr35/tr35-numbers.html + */ +var numberFormatProperties = function( pattern, cldr, options ) { + var negativePattern, negativePrefix, negativeProperties, negativeSuffix, positivePattern, + properties; + + function getOptions( attribute, propertyIndex ) { + if ( attribute in options ) { + properties[ propertyIndex ] = options[ attribute ]; + } + } + + options = options || {}; + pattern = pattern.split( ";" ); + + positivePattern = pattern[ 0 ]; + + negativePattern = pattern[ 1 ] || "-" + positivePattern; + negativeProperties = numberPatternProperties( negativePattern ); + negativePrefix = negativeProperties[ 0 ]; + negativeSuffix = negativeProperties[ 10 ]; + + properties = numberPatternProperties( positivePattern ).concat([ + positivePattern, + negativePrefix + positivePattern + negativeSuffix, + negativePrefix, + negativeSuffix, + numberRound( options.round ), + numberSymbol( "infinity", cldr ), + numberSymbol( "nan", cldr ), + numberSymbolMap( cldr ), + numberNumberingSystemDigitsMap( cldr ) + ]); + + getOptions( "minimumIntegerDigits", 2 ); + getOptions( "minimumFractionDigits", 3 ); + getOptions( "maximumFractionDigits", 4 ); + getOptions( "minimumSignificantDigits", 5 ); + getOptions( "maximumSignificantDigits", 6 ); + + // Grouping separators + if ( options.useGrouping === false ) { + properties[ 8 ] = null; + } + + // Normalize number of digits if only one of either minimumFractionDigits or + // maximumFractionDigits is passed in as an option + if ( "minimumFractionDigits" in options && !( "maximumFractionDigits" in options ) ) { + // maximumFractionDigits = Math.max( minimumFractionDigits, maximumFractionDigits ); + properties[ 4 ] = Math.max( properties[ 3 ], properties[ 4 ] ); + } else if ( !( "minimumFractionDigits" in options ) && + "maximumFractionDigits" in options ) { + // minimumFractionDigits = Math.min( minimumFractionDigits, maximumFractionDigits ); + properties[ 3 ] = Math.min( properties[ 3 ], properties[ 4 ] ); + } + + // Return: + // 0-10: see number/pattern-properties. + // 11: @positivePattern [String] Positive pattern. + // 12: @negativePattern [String] Negative pattern. + // 13: @negativePrefix [String] Negative prefix. + // 14: @negativeSuffix [String] Negative suffix. + // 15: @round [Function] Round function. + // 16: @infinitySymbol [String] Infinity symbol. + // 17: @nanSymbol [String] NaN symbol. + // 18: @symbolMap [Object] A bunch of other symbols. + // 19: @nuDigitsMap [Array] Digits map if numbering system is different than `latn`. + return properties; +}; + + + + +/** + * EBNF representation: + * + * number_pattern_re = prefix_including_padding? + * number + * scientific_notation? + * suffix? + * + * number = integer_including_group_separator fraction_including_decimal_separator + * + * integer_including_group_separator = + * regexp([0-9,]*[0-9]+) + * + * fraction_including_decimal_separator = + * regexp((\.[0-9]+)?) + + * prefix_including_padding = non_number_stuff + * + * scientific_notation = regexp(E[+-]?[0-9]+) + * + * suffix = non_number_stuff + * + * non_number_stuff = regexp([^0-9]*) + * + * + * Regexp groups: + * + * 0: number_pattern_re + * 1: prefix + * 2: integer_including_group_separator fraction_including_decimal_separator + * 3: integer_including_group_separator + * 4: fraction_including_decimal_separator + * 5: scientific_notation + * 6: suffix + */ +var numberNumberRe = (/^([^0-9]*)(([0-9,]*[0-9]+)(\.[0-9]+)?)(E[+-]?[0-9]+)?([^0-9]*)$/); + + + + +/** + * parse( value, properties ) + * + * @value [String]. + * + * @properties [Object] Parser properties is a reduced pre-processed cldr + * data set returned by numberParserProperties(). + * + * Return the parsed Number (including Infinity) or NaN when value is invalid. + * ref: http://www.unicode.org/reports/tr35/tr35-numbers.html + */ +var numberParse = function( value, properties ) { + var aux, infinitySymbol, invertedNuDigitsMap, invertedSymbolMap, localizedDigitRe, + localizedSymbolsRe, negativePrefix, negativeSuffix, number, prefix, suffix; + + infinitySymbol = properties[ 0 ]; + invertedSymbolMap = properties[ 1 ]; + negativePrefix = properties[ 2 ]; + negativeSuffix = properties[ 3 ]; + invertedNuDigitsMap = properties[ 4 ]; + + // Infinite number. + if ( aux = value.match( infinitySymbol ) ) { + + number = Infinity; + prefix = value.slice( 0, aux.length ); + suffix = value.slice( aux.length + 1 ); + + // Finite number. + } else { + + // TODO: Create it during setup, i.e., make it a property. + localizedSymbolsRe = new RegExp( + Object.keys( invertedSymbolMap ).map(function( localizedSymbol ) { + return regexpEscape( localizedSymbol ); + }).join( "|" ), + "g" + ); + + // Reverse localized symbols. + value = value.replace( localizedSymbolsRe, function( localizedSymbol ) { + return invertedSymbolMap[ localizedSymbol ]; + }); + + // Reverse localized numbering system. + if ( invertedNuDigitsMap ) { + + // TODO: Create it during setup, i.e., make it a property. + localizedDigitRe = new RegExp( + Object.keys( invertedNuDigitsMap ).map(function( localizedDigit ) { + return regexpEscape( localizedDigit ); + }).join( "|" ), + "g" + ); + value = value.replace( localizedDigitRe, function( localizedDigit ) { + return invertedNuDigitsMap[ localizedDigit ]; + }); + } + + // Is it a valid number? + value = value.match( numberNumberRe ); + if ( !value ) { + + // Invalid number. + return NaN; + } + + prefix = value[ 1 ]; + suffix = value[ 6 ]; + + // Remove grouping separators. + number = value[ 2 ].replace( /,/g, "" ); + + // Scientific notation + if ( value[ 5 ] ) { + number += value[ 5 ]; + } + + number = +number; + + // Is it a valid number? + if ( isNaN( number ) ) { + + // Invalid number. + return NaN; + } + + // Percent + if ( value[ 0 ].indexOf( "%" ) !== -1 ) { + number /= 100; + suffix = suffix.replace( "%", "" ); + + // Per mille + } else if ( value[ 0 ].indexOf( "\u2030" ) !== -1 ) { + number /= 1000; + suffix = suffix.replace( "\u2030", "" ); + } + } + + // Negative number + // "If there is an explicit negative subpattern, it serves only to specify the negative prefix + // and suffix. If there is no explicit negative subpattern, the negative subpattern is the + // localized minus sign prefixed to the positive subpattern" UTS#35 + if ( prefix === negativePrefix && suffix === negativeSuffix ) { + number *= -1; + } + + return number; +}; + + + + +/** + * symbolMap( cldr ) + * + * @cldr [Cldr instance]. + * + * Return the (localized symbol, pattern symbol) key value pair, eg. { + * "٫": ".", + * "٬": ",", + * "٪": "%", + * ... + * }; + */ +var numberSymbolInvertedMap = function( cldr ) { + var symbol, + symbolMap = {}; + + for ( symbol in numberSymbolName ) { + symbolMap[ numberSymbol( numberSymbolName[ symbol ], cldr ) ] = symbol; + } + + return symbolMap; +}; + + + + +/** + * parseProperties( pattern, cldr ) + * + * @pattern [String] raw pattern for numbers. + * + * @cldr [Cldr instance]. + * + * Return parser properties, used to feed parser function. + */ +var numberParseProperties = function( pattern, cldr ) { + var invertedNuDigitsMap, invertedNuDigitsMapSanityCheck, negativePattern, negativeProperties, + nuDigitsMap = numberNumberingSystemDigitsMap( cldr ); + + pattern = pattern.split( ";" ); + negativePattern = pattern[ 1 ] || "-" + pattern[ 0 ]; + negativeProperties = numberPatternProperties( negativePattern ); + if ( nuDigitsMap ) { + invertedNuDigitsMap = nuDigitsMap.split( "" ).reduce(function( object, localizedDigit, i ) { + object[ localizedDigit ] = String( i ); + return object; + }, {} ); + invertedNuDigitsMapSanityCheck = "0123456789".split( "" ).reduce(function( object, digit ) { + object[ digit ] = "invalid"; + return object; + }, {} ); + invertedNuDigitsMap = objectExtend( + invertedNuDigitsMapSanityCheck, + invertedNuDigitsMap + ); + } + + // 0: @infinitySymbol [String] Infinity symbol. + // 1: @invertedSymbolMap [Object] Inverted symbol map augmented with sanity check. + // The sanity check prevents permissive parsing, i.e., it prevents symbols that doesn't + // belong to the localized set to pass through. This is obtained with the result of the + // inverted map object overloading symbol name map object (the remaining symbol name + // mappings will invalidate parsing, working as the sanity check). + // 2: @negativePrefix [String] Negative prefix. + // 3: @negativeSuffix [String] Negative suffix with percent or per mille stripped out. + // 4: @invertedNuDigitsMap [Object] Inverted digits map if numbering system is different than + // `latn` augmented with sanity check (similar to invertedSymbolMap). + return [ + numberSymbol( "infinity", cldr ), + objectExtend( {}, numberSymbolName, numberSymbolInvertedMap( cldr ) ), + negativeProperties[ 0 ], + negativeProperties[ 10 ].replace( "%", "" ).replace( "\u2030", "" ), + invertedNuDigitsMap + ]; +}; + + + + +/** + * Pattern( style ) + * + * @style [String] "decimal" (default) or "percent". + * + * @cldr [Cldr instance]. + */ +var numberPattern = function( style, cldr ) { + if ( style !== "decimal" && style !== "percent" ) { + throw new Error( "Invalid style" ); + } + + return cldr.main([ + "numbers", + style + "Formats-numberSystem-" + numberNumberingSystem( cldr ), + "standard" + ]); +}; + + + + +/** + * .numberFormatter( [options] ) + * + * @options [Object]: + * - style: [String] "decimal" (default) or "percent". + * - see also number/format options. + * + * Return a function that formats a number according to the given options and default/instance + * locale. + */ +Globalize.numberFormatter = +Globalize.prototype.numberFormatter = function( options ) { + var cldr, maximumFractionDigits, maximumSignificantDigits, minimumFractionDigits, + minimumIntegerDigits, minimumSignificantDigits, pattern, properties; + + validateParameterTypePlainObject( options, "options" ); + + options = options || {}; + cldr = this.cldr; + + validateDefaultLocale( cldr ); + + cldr.on( "get", validateCldr ); + + if ( options.raw ) { + pattern = options.raw; + } else { + pattern = numberPattern( options.style || "decimal", cldr ); + } + + properties = numberFormatProperties( pattern, cldr, options ); + + cldr.off( "get", validateCldr ); + + minimumIntegerDigits = properties[ 2 ]; + minimumFractionDigits = properties[ 3 ]; + maximumFractionDigits = properties[ 4 ]; + + minimumSignificantDigits = properties[ 5 ]; + maximumSignificantDigits = properties[ 6 ]; + + // Validate significant digit format properties + if ( !isNaN( minimumSignificantDigits * maximumSignificantDigits ) ) { + validateParameterRange( minimumSignificantDigits, "minimumSignificantDigits", 1, 21 ); + validateParameterRange( maximumSignificantDigits, "maximumSignificantDigits", + minimumSignificantDigits, 21 ); + + } else if ( !isNaN( minimumSignificantDigits ) || !isNaN( maximumSignificantDigits ) ) { + throw new Error( "Neither or both the minimum and maximum significant digits must be " + + "present" ); + + // Validate integer and fractional format + } else { + validateParameterRange( minimumIntegerDigits, "minimumIntegerDigits", 1, 21 ); + validateParameterRange( minimumFractionDigits, "minimumFractionDigits", 0, 20 ); + validateParameterRange( maximumFractionDigits, "maximumFractionDigits", + minimumFractionDigits, 20 ); + } + + return function( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + return numberFormat( value, properties ); + }; +}; + +/** + * .numberParser( [options] ) + * + * @options [Object]: + * - style: [String] "decimal" (default) or "percent". + * + * Return the number parser according to the default/instance locale. + */ +Globalize.numberParser = +Globalize.prototype.numberParser = function( options ) { + var cldr, pattern, properties; + + validateParameterTypePlainObject( options, "options" ); + + options = options || {}; + cldr = this.cldr; + + validateDefaultLocale( cldr ); + + cldr.on( "get", validateCldr ); + + if ( options.raw ) { + pattern = options.raw; + } else { + pattern = numberPattern( options.style || "decimal", cldr ); + } + + properties = numberParseProperties( pattern, cldr ); + + cldr.off( "get", validateCldr ); + + return function( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeString( value, "value" ); + return numberParse( value, properties ); + }; +}; + +/** + * .formatNumber( value [, options] ) + * + * @value [Number] number to be formatted. + * + * @options [Object]: see number/format-properties. + * + * Format a number according to the given options and default/instance locale. + */ +Globalize.formatNumber = +Globalize.prototype.formatNumber = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return this.numberFormatter( options )( value ); +}; + +/** + * .parseNumber( value [, options] ) + * + * @value [String] + * + * @options [Object]: See numberParser(). + * + * Return the parsed Number (including Infinity) or NaN when value is invalid. + */ +Globalize.parseNumber = +Globalize.prototype.parseNumber = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeString( value, "value" ); + + return this.numberParser( options )( value ); +}; + +/** + * Optimization to avoid duplicating some internal functions across modules. + */ +Globalize._createErrorUnsupportedFeature = createErrorUnsupportedFeature; +Globalize._numberNumberingSystem = numberNumberingSystem; +Globalize._numberPattern = numberPattern; +Globalize._numberSymbol = numberSymbol; +Globalize._stringPad = stringPad; +Globalize._validateParameterTypeNumber = validateParameterTypeNumber; +Globalize._validateParameterTypeString = validateParameterTypeString; + +return Globalize; + + + + +})); diff --git a/external/localization.js b/external/localization.js index 2db980a58..2879601f8 100644 --- a/external/localization.js +++ b/external/localization.js @@ -20,11 +20,11 @@ Globalize.load({ "ar": { "identity": { "version": { - "_cldrVersion": "25", - "_number": "$Revision: 91 $" + "_cldrVersion": "27.0.1", + "_number": "$Revision: 11294 $" }, "generation": { - "_date": "$Date: 2014-03-13 22:27:12 -0500 (Thu, 13 Mar 2014) $" + "_date": "$Date: 2015-02-23 16:50:24 -0600 (Mon, 23 Feb 2015) $" }, "language": "ar" }, @@ -245,34 +245,34 @@ Globalize.load({ "format": { "abbreviated": { "am": "ص", - "noon": "noon", + "noon": "ظهرا", "pm": "م" }, "narrow": { - "am": "a", - "noon": "n", - "pm": "p" + "am": "ص", + "noon": "ظ", + "pm": "م" }, "wide": { "am": "ص", - "noon": "noon", + "noon": "ظهرا", "pm": "م" } }, "stand-alone": { "abbreviated": { "am": "ص", - "noon": "noon", + "noon": "ظهرا", "pm": "م" }, "narrow": { - "am": "a", - "noon": "n", - "pm": "p" + "am": "ص", + "noon": "ظ", + "pm": "م" }, "wide": { "am": "ص", - "noon": "noon", + "noon": "ظهرا", "pm": "م" } } @@ -282,19 +282,19 @@ Globalize.load({ "0": "قبل الميلاد", "0-alt-variant": "BCE", "1": "ميلادي", - "1-alt-variant": "CE" + "1-alt-variant": "بعد الميلاد" }, "eraAbbr": { "0": "ق.م", "0-alt-variant": "BCE", "1": "م", - "1-alt-variant": "CE" + "1-alt-variant": "ب.م" }, "eraNarrow": { "0": "ق.م", "0-alt-variant": "BCE", "1": "م", - "1-alt-variant": "CE" + "1-alt-variant": "ب.م" } }, "dateFormats": { @@ -315,6 +315,7 @@ Globalize.load({ "medium": "{1} {0}", "short": "{1} {0}", "availableFormats": { + "E": "ccc", "EHm": "E HH:mm", "EHms": "E HH:mm:ss", "Ed": "E، d", @@ -327,6 +328,8 @@ Globalize.load({ "H": "HH", "Hm": "HH:mm", "Hms": "HH:mm:ss", + "Hmsv": "HH:mm:ss v", + "Hmv": "HH:mm v", "M": "L", "MEd": "E، d/M", "MMM": "LLL", @@ -340,6 +343,8 @@ Globalize.load({ "h": "h a", "hm": "h:mm a", "hms": "h:mm:ss a", + "hmsv": "h:mm:ss a v", + "hmv": "h:mm a v", "ms": "mm:ss", "y": "y", "yM": "M‏/y", @@ -467,6 +472,415 @@ Globalize.load({ } } } + }, + "numbers": { + "defaultNumberingSystem": "arab", + "otherNumberingSystems": { + "native": "arab" + }, + "minimumGroupingDigits": "1", + "symbols-numberSystem-arab": { + "decimal": "٫", + "group": "٬", + "list": "؛", + "percentSign": "٪", + "plusSign": "‏+", + "minusSign": "‏-", + "exponential": "اس", + "superscriptingExponent": "×", + "perMille": "؉", + "infinity": "∞", + "nan": "ليس رقم", + "timeSeparator": "،" + }, + "symbols-numberSystem-latn": { + "decimal": ".", + "group": ",", + "list": ";", + "percentSign": "%", + "plusSign": "‎+", + "minusSign": "‎-", + "exponential": "E", + "superscriptingExponent": "×", + "perMille": "‰", + "infinity": "∞", + "nan": "NaN", + "timeSeparator": ":" + }, + "decimalFormats-numberSystem-arab": { + "standard": "#,##0.###", + "long": { + "decimalFormat": { + "1000-count-zero": "0 ألف", + "1000-count-one": "0 ألف", + "1000-count-two": "0 ألف", + "1000-count-few": "0 ألف", + "1000-count-many": "0 ألف", + "1000-count-other": "0 ألف", + "10000-count-zero": "00 ألف", + "10000-count-one": "00 ألف", + "10000-count-two": "00 ألف", + "10000-count-few": "00 ألف", + "10000-count-many": "00 ألف", + "10000-count-other": "00 ألف", + "100000-count-zero": "000 ألف", + "100000-count-one": "000 ألف", + "100000-count-two": "000 ألف", + "100000-count-few": "000 ألف", + "100000-count-many": "000 ألف", + "100000-count-other": "000 ألف", + "1000000-count-zero": "0 مليون", + "1000000-count-one": "0 مليون", + "1000000-count-two": "0 مليون", + "1000000-count-few": "0 مليون", + "1000000-count-many": "0 مليون", + "1000000-count-other": "0 مليون", + "10000000-count-zero": "00 مليون", + "10000000-count-one": "00 مليون", + "10000000-count-two": "00 مليون", + "10000000-count-few": "00 مليون", + "10000000-count-many": "00 مليون", + "10000000-count-other": "00 مليون", + "100000000-count-zero": "000 مليون", + "100000000-count-one": "000 مليون", + "100000000-count-two": "000 مليون", + "100000000-count-few": "000 مليون", + "100000000-count-many": "000 مليون", + "100000000-count-other": "000 مليون", + "1000000000-count-zero": "0 بليون", + "1000000000-count-one": "0 بليون", + "1000000000-count-two": "0 بليون", + "1000000000-count-few": "0 بليون", + "1000000000-count-many": "0 بليون", + "1000000000-count-other": "0 بليون", + "10000000000-count-zero": "00 بليون", + "10000000000-count-one": "00 بليون", + "10000000000-count-two": "00 بليون", + "10000000000-count-few": "00 بليون", + "10000000000-count-many": "00 بليون", + "10000000000-count-other": "00 بليون", + "100000000000-count-zero": "000 بليون", + "100000000000-count-one": "000 بليون", + "100000000000-count-two": "000 بليون", + "100000000000-count-few": "000 بليون", + "100000000000-count-many": "000 بليون", + "100000000000-count-other": "000 بليون", + "1000000000000-count-zero": "0 تريليون", + "1000000000000-count-one": "0 تريليون", + "1000000000000-count-two": "0 تريليون", + "1000000000000-count-few": "0 تريليون", + "1000000000000-count-many": "0 تريليون", + "1000000000000-count-other": "0 تريليون", + "10000000000000-count-zero": "00 تريليون", + "10000000000000-count-one": "00 تريليون", + "10000000000000-count-two": "00 تريليون", + "10000000000000-count-few": "00 تريليون", + "10000000000000-count-many": "00 تريليون", + "10000000000000-count-other": "00 تريليون", + "100000000000000-count-zero": "000 تريليون", + "100000000000000-count-one": "000 تريليون", + "100000000000000-count-two": "000 تريليون", + "100000000000000-count-few": "000 تريليون", + "100000000000000-count-many": "000 تريليون", + "100000000000000-count-other": "000 تريليون" + } + }, + "short": { + "decimalFormat": { + "1000-count-zero": "0 ألف", + "1000-count-one": "0 ألف", + "1000-count-two": "0 ألف", + "1000-count-few": "0 ألف", + "1000-count-many": "0 ألف", + "1000-count-other": "0 ألف", + "10000-count-zero": "00 ألف", + "10000-count-one": "00 ألف", + "10000-count-two": "00 ألف", + "10000-count-few": "00 ألف", + "10000-count-many": "00 ألف", + "10000-count-other": "00 ألف", + "100000-count-zero": "000 ألف", + "100000-count-one": "000 ألف", + "100000-count-two": "000 ألف", + "100000-count-few": "000 ألف", + "100000-count-many": "000 ألف", + "100000-count-other": "000 ألف", + "1000000-count-zero": "0 مليو", + "1000000-count-one": "0 مليو", + "1000000-count-two": "0 مليو", + "1000000-count-few": "0 مليو", + "1000000-count-many": "0 مليو", + "1000000-count-other": "0 مليو", + "10000000-count-zero": "00 مليو", + "10000000-count-one": "00 مليو", + "10000000-count-two": "00 مليو", + "10000000-count-few": "00 مليو", + "10000000-count-many": "00 مليو", + "10000000-count-other": "00 مليو", + "100000000-count-zero": "000 مليو", + "100000000-count-one": "000 مليو", + "100000000-count-two": "000 مليو", + "100000000-count-few": "000 مليو", + "100000000-count-many": "000 مليو", + "100000000-count-other": "000 مليو", + "1000000000-count-zero": "0 بليو", + "1000000000-count-one": "0 بليو", + "1000000000-count-two": "0 بليو", + "1000000000-count-few": "0 بليو", + "1000000000-count-many": "0 بليو", + "1000000000-count-other": "0 بليو", + "10000000000-count-zero": "00 بليو", + "10000000000-count-one": "00 بليو", + "10000000000-count-two": "00 بليو", + "10000000000-count-few": "00 بليو", + "10000000000-count-many": "00 بليو", + "10000000000-count-other": "00 بليو", + "100000000000-count-zero": "000 بليو", + "100000000000-count-one": "000 بليو", + "100000000000-count-two": "000 بليو", + "100000000000-count-few": "000 بليو", + "100000000000-count-many": "000 بليو", + "100000000000-count-other": "000 بليو", + "1000000000000-count-zero": "0 ترليو", + "1000000000000-count-one": "0 ترليو", + "1000000000000-count-two": "0 ترليو", + "1000000000000-count-few": "0 ترليو", + "1000000000000-count-many": "0 ترليو", + "1000000000000-count-other": "0 ترليو", + "10000000000000-count-zero": "00 ترليو", + "10000000000000-count-one": "00 ترليو", + "10000000000000-count-two": "00 ترليو", + "10000000000000-count-few": "00 ترليو", + "10000000000000-count-many": "00 ترليو", + "10000000000000-count-other": "00 ترليو", + "100000000000000-count-zero": "000 ترليو", + "100000000000000-count-one": "000 ترليو", + "100000000000000-count-two": "000 ترليو", + "100000000000000-count-few": "000 ترليو", + "100000000000000-count-many": "000 ترليو", + "100000000000000-count-other": "000 ترليو" + } + } + }, + "decimalFormats-numberSystem-latn": { + "standard": "#,##0.###", + "long": { + "decimalFormat": { + "1000-count-zero": "0 ألف", + "1000-count-one": "0 ألف", + "1000-count-two": "0 ألف", + "1000-count-few": "0 آلاف", + "1000-count-many": "0 ألف", + "1000-count-other": "0 ألف", + "10000-count-zero": "00 ألف", + "10000-count-one": "00 ألف", + "10000-count-two": "00 ألف", + "10000-count-few": "00 ألف", + "10000-count-many": "00 ألف", + "10000-count-other": "00 ألف", + "100000-count-zero": "000 ألف", + "100000-count-one": "000 ألف", + "100000-count-two": "000 ألف", + "100000-count-few": "000 ألف", + "100000-count-many": "000 ألف", + "100000-count-other": "000 ألف", + "1000000-count-zero": "0 مليون", + "1000000-count-one": "0 مليون", + "1000000-count-two": "0 مليون", + "1000000-count-few": "0 ملايين", + "1000000-count-many": "0 مليون", + "1000000-count-other": "0 مليون", + "10000000-count-zero": "00 مليون", + "10000000-count-one": "00 مليون", + "10000000-count-two": "00 مليون", + "10000000-count-few": "00 ملايين", + "10000000-count-many": "00 مليون", + "10000000-count-other": "00 مليون", + "100000000-count-zero": "000 مليون", + "100000000-count-one": "000 مليون", + "100000000-count-two": "000 مليون", + "100000000-count-few": "000 مليون", + "100000000-count-many": "000 مليون", + "100000000-count-other": "000 مليون", + "1000000000-count-zero": "0 بليون", + "1000000000-count-one": "0 بليون", + "1000000000-count-two": "0 بليون", + "1000000000-count-few": "0 بلايين", + "1000000000-count-many": "0 بليون", + "1000000000-count-other": "0 بليون", + "10000000000-count-zero": "00 بليون", + "10000000000-count-one": "00 بليون", + "10000000000-count-two": "00 بليون", + "10000000000-count-few": "00 بليون", + "10000000000-count-many": "00 بليون", + "10000000000-count-other": "00 بليون", + "100000000000-count-zero": "000 بليون", + "100000000000-count-one": "000 بليون", + "100000000000-count-two": "000 بليون", + "100000000000-count-few": "000 بليون", + "100000000000-count-many": "000 بليون", + "100000000000-count-other": "000 بليون", + "1000000000000-count-zero": "0 تريليون", + "1000000000000-count-one": "0 تريليون", + "1000000000000-count-two": "0 تريليون", + "1000000000000-count-few": "0 تريليونات", + "1000000000000-count-many": "0 تريليون", + "1000000000000-count-other": "0 تريليون", + "10000000000000-count-zero": "00 تريليون", + "10000000000000-count-one": "00 تريليون", + "10000000000000-count-two": "00 تريليون", + "10000000000000-count-few": "00 تريليون", + "10000000000000-count-many": "00 تريليون", + "10000000000000-count-other": "00 تريليون", + "100000000000000-count-zero": "000 تريليون", + "100000000000000-count-one": "000 تريليون", + "100000000000000-count-two": "000 تريليون", + "100000000000000-count-few": "000 تريليون", + "100000000000000-count-many": "000 تريليون", + "100000000000000-count-other": "000 تريليون" + } + }, + "short": { + "decimalFormat": { + "1000-count-zero": "0 ألف", + "1000-count-one": "0 ألف", + "1000-count-two": "0 ألف", + "1000-count-few": "0 آلاف", + "1000-count-many": "0 ألف", + "1000-count-other": "0 ألف", + "10000-count-zero": "00 ألف", + "10000-count-one": "00 ألف", + "10000-count-two": "00 ألف", + "10000-count-few": "00 ألف", + "10000-count-many": "00 ألف", + "10000-count-other": "00 ألف", + "100000-count-zero": "000 ألف", + "100000-count-one": "000 ألف", + "100000-count-two": "000 ألف", + "100000-count-few": "000 ألف", + "100000-count-many": "000 ألف", + "100000-count-other": "000 ألف", + "1000000-count-zero": "0 مليو", + "1000000-count-one": "0 مليو", + "1000000-count-two": "0 مليو", + "1000000-count-few": "0 مليو", + "1000000-count-many": "0 مليو", + "1000000-count-other": "0 مليو", + "10000000-count-zero": "00 مليو", + "10000000-count-one": "00 مليو", + "10000000-count-two": "00 مليو", + "10000000-count-few": "00 مليو", + "10000000-count-many": "00 مليو", + "10000000-count-other": "00 مليو", + "100000000-count-zero": "000 مليو", + "100000000-count-one": "000 مليو", + "100000000-count-two": "000 مليو", + "100000000-count-few": "000 مليو", + "100000000-count-many": "000 مليو", + "100000000-count-other": "000 مليو", + "1000000000-count-zero": "0 بليو", + "1000000000-count-one": "0 بليو", + "1000000000-count-two": "0 بليو", + "1000000000-count-few": "0 بليو", + "1000000000-count-many": "0 بليو", + "1000000000-count-other": "0 بليو", + "10000000000-count-zero": "00 بليو", + "10000000000-count-one": "00 بليو", + "10000000000-count-two": "00 بليو", + "10000000000-count-few": "00 بليو", + "10000000000-count-many": "00 بليو", + "10000000000-count-other": "00 بليو", + "100000000000-count-zero": "000 بليو", + "100000000000-count-one": "000 بليو", + "100000000000-count-two": "000 بليو", + "100000000000-count-few": "000 بليو", + "100000000000-count-many": "000 بليو", + "100000000000-count-other": "000 بليو", + "1000000000000-count-zero": "0 ترليو", + "1000000000000-count-one": "0 ترليو", + "1000000000000-count-two": "0 ترليو", + "1000000000000-count-few": "0 ترليو", + "1000000000000-count-many": "0 ترليو", + "1000000000000-count-other": "0 ترليو", + "10000000000000-count-zero": "00 ترليو", + "10000000000000-count-one": "00 ترليو", + "10000000000000-count-two": "00 ترليو", + "10000000000000-count-few": "00 ترليو", + "10000000000000-count-many": "00 ترليو", + "10000000000000-count-other": "00 ترليو", + "100000000000000-count-zero": "000 ترليو", + "100000000000000-count-one": "000 ترليو", + "100000000000000-count-two": "000 ترليو", + "100000000000000-count-few": "000 ترليو", + "100000000000000-count-many": "000 ترليو", + "100000000000000-count-other": "000 ترليو" + } + } + }, + "scientificFormats-numberSystem-arab": { + "standard": "#E0" + }, + "scientificFormats-numberSystem-latn": { + "standard": "#E0" + }, + "percentFormats-numberSystem-arab": { + "standard": "#,##0%" + }, + "percentFormats-numberSystem-latn": { + "standard": "#,##0%" + }, + "currencyFormats-numberSystem-arab": { + "currencySpacing": { + "beforeCurrency": { + "currencyMatch": "[:^S:]", + "surroundingMatch": "[:digit:]", + "insertBetween": " " + }, + "afterCurrency": { + "currencyMatch": "[:^S:]", + "surroundingMatch": "[:digit:]", + "insertBetween": " " + } + }, + "accounting": "¤#,##0.00;(¤#,##0.00)", + "standard": "¤ #,##0.00", + "unitPattern-count-zero": "{0} {1}", + "unitPattern-count-one": "{0} {1}", + "unitPattern-count-two": "{0} {1}", + "unitPattern-count-few": "{0} {1}", + "unitPattern-count-many": "{0} {1}", + "unitPattern-count-other": "{0} {1}" + }, + "currencyFormats-numberSystem-latn": { + "currencySpacing": { + "beforeCurrency": { + "currencyMatch": "[:^S:]", + "surroundingMatch": "[:digit:]", + "insertBetween": " " + }, + "afterCurrency": { + "currencyMatch": "[:^S:]", + "surroundingMatch": "[:digit:]", + "insertBetween": " " + } + }, + "accounting": "¤#,##0.00;(¤#,##0.00)", + "standard": "¤ #,##0.00", + "unitPattern-count-zero": "{0} {1}", + "unitPattern-count-one": "{0} {1}", + "unitPattern-count-two": "{0} {1}", + "unitPattern-count-few": "{0} {1}", + "unitPattern-count-many": "{0} {1}", + "unitPattern-count-other": "{0} {1}" + }, + "miscPatterns-numberSystem-arab": { + "atLeast": "+{0}", + "range": "{0}–{1}" + }, + "miscPatterns-numberSystem-latn": { + "atLeast": "+{0}", + "range": "{0}–{1}" + } } } } @@ -477,11 +891,11 @@ Globalize.load({ "es": { "identity": { "version": { - "_cldrVersion": "25", - "_number": "$Revision: 91 $" + "_cldrVersion": "27.0.1", + "_number": "$Revision: 11321 $" }, "generation": { - "_date": "$Date: 2014-03-13 22:27:12 -0500 (Thu, 13 Mar 2014) $" + "_date": "$Date: 2015-02-26 14:20:05 -0600 (Thu, 26 Feb 2015) $" }, "language": "es" }, @@ -665,10 +1079,10 @@ Globalize.load({ "4": "T4" }, "narrow": { - "1": "1T", - "2": "2T", - "3": "3T", - "4": "4T" + "1": "1", + "2": "2", + "3": "3", + "4": "4" }, "wide": { "1": "1.er trimestre", @@ -685,10 +1099,10 @@ Globalize.load({ "4": "T4" }, "narrow": { - "1": "1T", - "2": "2T", - "3": "3T", - "4": "4T" + "1": "1", + "2": "2", + "3": "3", + "4": "4" }, "wide": { "1": "1.er trimestre", @@ -702,34 +1116,34 @@ Globalize.load({ "format": { "abbreviated": { "am": "a. m.", - "noon": "noon", + "noon": "mediodía", "pm": "p. m." }, "narrow": { "am": "a.m.", - "noon": "n", + "noon": "m.", "pm": "p.m." }, "wide": { "am": "a. m.", - "noon": "noon", + "noon": "mediodía", "pm": "p. m." } }, "stand-alone": { "abbreviated": { "am": "a. m.", - "noon": "noon", + "noon": "mediodía", "pm": "p. m." }, "narrow": { "am": "a.m.", - "noon": "n", + "noon": "m.", "pm": "p.m." }, "wide": { "am": "a. m.", - "noon": "noon", + "noon": "mediodía", "pm": "p. m." } } @@ -737,9 +1151,9 @@ Globalize.load({ "eras": { "eraNames": { "0": "antes de Cristo", - "0-alt-variant": "a. e. c.", - "1": "anno Dómini", - "1-alt-variant": "e. c." + "0-alt-variant": "antes de la era común", + "1": "después de Cristo", + "1-alt-variant": "era común" }, "eraAbbr": { "0": "a. C.", @@ -757,7 +1171,7 @@ Globalize.load({ "dateFormats": { "full": "EEEE, d 'de' MMMM 'de' y", "long": "d 'de' MMMM 'de' y", - "medium": "d/M/y", + "medium": "d MMM y", "short": "d/M/yy" }, "timeFormats": { @@ -772,25 +1186,32 @@ Globalize.load({ "medium": "{1} {0}", "short": "{1} {0}", "availableFormats": { + "E": "ccc", "EHm": "E, H:mm", "EHms": "E, H:mm:ss", "Ed": "E d", "Ehm": "E, h:mm a", "Ehms": "E, h:mm:ss a", "Gy": "y G", - "GyMMM": "MMM 'de' y G", - "GyMMMEd": "E, d 'de' MMMM 'de' y G", - "GyMMMd": "d MMM 'de' y G", + "GyMMM": "MMM y G", + "GyMMMEd": "E, d MMM y G", + "GyMMMM": "MMMM 'de' y G", + "GyMMMMEd": "E, d 'de' MMMM 'de' y G", + "GyMMMMd": "d 'de' MMMM 'de' y G", + "GyMMMd": "d MMM y G", "H": "H", "Hm": "H:mm", "Hms": "H:mm:ss", + "Hmsv": "H:mm:ss v", + "Hmsvvvv": "H:mm:ss (vvvv)", + "Hmv": "H:mm v", "M": "L", "MEd": "E, d/M", "MMM": "LLL", - "MMMEd": "E d 'de' MMM", + "MMMEd": "E, d MMM", + "MMMMEd": "E, d 'de' MMMM", "MMMMd": "d 'de' MMMM", - "MMMd": "d 'de' MMM", - "MMMdd": "dd-MMM", + "MMMd": "d MMM", "MMd": "d/M", "MMdd": "d/M", "Md": "d/M", @@ -798,15 +1219,20 @@ Globalize.load({ "h": "h a", "hm": "h:mm a", "hms": "h:mm:ss a", + "hmsv": "h:mm:ss a v", + "hmsvvvv": "h:mm:ss a (vvvv)", + "hmv": "h:mm a v", "ms": "mm:ss", "y": "y", "yM": "M/y", "yMEd": "EEE, d/M/y", "yMM": "M/y", - "yMMM": "MMM 'de' y", - "yMMMEd": "EEE, d 'de' MMMM 'de' y", + "yMMM": "MMM y", + "yMMMEd": "EEE, d MMM y", "yMMMM": "MMMM 'de' y", - "yMMMd": "d 'de' MMM 'de' y", + "yMMMMEd": "EEE, d 'de' MMMM 'de' y", + "yMMMMd": "d 'de' MMMM 'de' y", + "yMMMd": "d MMM y", "yMd": "d/M/y", "yQQQ": "QQQ y", "yQQQQ": "QQQQ 'de' y" @@ -854,6 +1280,14 @@ Globalize.load({ "M": "E, d MMM–E, d MMM", "d": "E, d MMM–E, d MMM" }, + "MMMMEd": { + "M": "E, d 'de' MMMM–E, d 'de' MMMM", + "d": "E, d 'de' MMMM–E, d 'de' MMMM" + }, + "MMMMd": { + "M": "d 'de' MMMM–d 'de' MMMM", + "d": "d–d 'de' MMMM" + }, "MMMd": { "M": "d MMM–d MMM", "d": "d–d MMM" @@ -900,18 +1334,28 @@ Globalize.load({ "y": "MMM y–MMM y" }, "yMMMEd": { - "M": "E, d MMM–E, d MMM 'de' y", - "d": "E, d MMM–E, d MMM 'de' y", - "y": "E, d MMM 'de' y–E, d MMM 'de' y" + "M": "E, d MMM–E, d MMM y", + "d": "E, d MMM–E, d MMM y", + "y": "E, d MMM y–E, d MMM y" }, "yMMMM": { "M": "MMMM–MMMM 'de' y", "y": "MMMM 'de' y–MMMM 'de' y" }, + "yMMMMEd": { + "M": "E, d 'de' MMMM–E, d 'de' MMMM 'de' y", + "d": "E, d 'de' MMMM–E, d 'de' MMMM 'de' y", + "y": "E, d 'de' MMMM 'de' y–E, d 'de' MMMM 'de' y" + }, + "yMMMMd": { + "M": "d 'de' MMMM–d 'de' MMMM 'de' y", + "d": "d–d 'de' MMMM 'de' y", + "y": "d 'de' MMMM 'de' y–d 'de' MMMM 'de' y" + }, "yMMMd": { - "M": "d MMM–d MMM 'de' y", + "M": "d MMM–d MMM y", "d": "d–d MMM y", - "y": "d MMM 'de' y–d MMM 'de' y" + "y": "d MMM y–d MMM y" }, "yMd": { "M": "d/M/y–d/M/y", @@ -922,6 +1366,114 @@ Globalize.load({ } } } + }, + "numbers": { + "defaultNumberingSystem": "latn", + "otherNumberingSystems": { + "native": "latn" + }, + "minimumGroupingDigits": "1", + "symbols-numberSystem-latn": { + "decimal": ",", + "group": ".", + "list": ";", + "percentSign": "%", + "plusSign": "+", + "minusSign": "-", + "exponential": "E", + "superscriptingExponent": "×", + "perMille": "‰", + "infinity": "∞", + "nan": "NaN", + "timeSeparator": ":" + }, + "decimalFormats-numberSystem-latn": { + "standard": "#,##0.###", + "long": { + "decimalFormat": { + "1000-count-one": "0 mil", + "1000-count-other": "0 mil", + "10000-count-one": "00 mil", + "10000-count-other": "00 mil", + "100000-count-one": "000 mil", + "100000-count-other": "000 mil", + "1000000-count-one": "0 millón", + "1000000-count-other": "0 millones", + "10000000-count-one": "00 millones", + "10000000-count-other": "00 millones", + "100000000-count-one": "000 millones", + "100000000-count-other": "000 millones", + "1000000000-count-one": "0 mil millones", + "1000000000-count-other": "0 mil millones", + "10000000000-count-one": "00 mil millones", + "10000000000-count-other": "00 mil millones", + "100000000000-count-one": "000 mil millones", + "100000000000-count-other": "000 mil millones", + "1000000000000-count-one": "0 billón", + "1000000000000-count-other": "0 billones", + "10000000000000-count-one": "00 billones", + "10000000000000-count-other": "00 billones", + "100000000000000-count-one": "000 billones", + "100000000000000-count-other": "000 billones" + } + }, + "short": { + "decimalFormat": { + "1000-count-one": "0 K", + "1000-count-other": "0 K", + "10000-count-one": "00 K", + "10000-count-other": "00 K", + "100000-count-one": "000 K", + "100000-count-other": "000 K", + "1000000-count-one": "0 M", + "1000000-count-other": "0 M", + "10000000-count-one": "00 M", + "10000000-count-other": "00 M", + "100000000-count-one": "000 M", + "100000000-count-other": "000 M", + "1000000000-count-one": "0000 M", + "1000000000-count-other": "0000 M", + "10000000000-count-one": "00 MRD", + "10000000000-count-other": "00 MRD", + "100000000000-count-one": "000 MRD", + "100000000000-count-other": "000 MRD", + "1000000000000-count-one": "0 B", + "1000000000000-count-other": "0 B", + "10000000000000-count-one": "00 B", + "10000000000000-count-other": "00 B", + "100000000000000-count-one": "000 B", + "100000000000000-count-other": "000 B" + } + } + }, + "scientificFormats-numberSystem-latn": { + "standard": "#E0" + }, + "percentFormats-numberSystem-latn": { + "standard": "#,##0 %" + }, + "currencyFormats-numberSystem-latn": { + "currencySpacing": { + "beforeCurrency": { + "currencyMatch": "[:^S:]", + "surroundingMatch": "[:digit:]", + "insertBetween": " " + }, + "afterCurrency": { + "currencyMatch": "[:^S:]", + "surroundingMatch": "[:digit:]", + "insertBetween": " " + } + }, + "accounting": "#,##0.00 ¤", + "standard": "#,##0.00 ¤", + "unitPattern-count-one": "{0} {1}", + "unitPattern-count-other": "{0} {1}" + }, + "miscPatterns-numberSystem-latn": { + "atLeast": "Más de {0}", + "range": "{0}-{1}" + } } } } @@ -932,14 +1484,122 @@ Globalize.load({ "en": { "identity": { "version": { - "_cldrVersion": "25", - "_number": "$Revision: 91 $" + "_cldrVersion": "27.0.1", + "_number": "$Revision: 11348 $" }, "generation": { - "_date": "$Date: 2014-03-13 22:27:12 -0500 (Thu, 13 Mar 2014) $" + "_date": "$Date: 2015-03-05 01:15:52 -0600 (Thu, 05 Mar 2015) $" }, "language": "en" }, + "numbers": { + "defaultNumberingSystem": "latn", + "otherNumberingSystems": { + "native": "latn" + }, + "minimumGroupingDigits": "1", + "symbols-numberSystem-latn": { + "decimal": ".", + "group": ",", + "list": ";", + "percentSign": "%", + "plusSign": "+", + "minusSign": "-", + "exponential": "E", + "superscriptingExponent": "×", + "perMille": "‰", + "infinity": "∞", + "nan": "NaN", + "timeSeparator": ":" + }, + "decimalFormats-numberSystem-latn": { + "standard": "#,##0.###", + "long": { + "decimalFormat": { + "1000-count-one": "0 thousand", + "1000-count-other": "0 thousand", + "10000-count-one": "00 thousand", + "10000-count-other": "00 thousand", + "100000-count-one": "000 thousand", + "100000-count-other": "000 thousand", + "1000000-count-one": "0 million", + "1000000-count-other": "0 million", + "10000000-count-one": "00 million", + "10000000-count-other": "00 million", + "100000000-count-one": "000 million", + "100000000-count-other": "000 million", + "1000000000-count-one": "0 billion", + "1000000000-count-other": "0 billion", + "10000000000-count-one": "00 billion", + "10000000000-count-other": "00 billion", + "100000000000-count-one": "000 billion", + "100000000000-count-other": "000 billion", + "1000000000000-count-one": "0 trillion", + "1000000000000-count-other": "0 trillion", + "10000000000000-count-one": "00 trillion", + "10000000000000-count-other": "00 trillion", + "100000000000000-count-one": "000 trillion", + "100000000000000-count-other": "000 trillion" + } + }, + "short": { + "decimalFormat": { + "1000-count-one": "0K", + "1000-count-other": "0K", + "10000-count-one": "00K", + "10000-count-other": "00K", + "100000-count-one": "000K", + "100000-count-other": "000K", + "1000000-count-one": "0M", + "1000000-count-other": "0M", + "10000000-count-one": "00M", + "10000000-count-other": "00M", + "100000000-count-one": "000M", + "100000000-count-other": "000M", + "1000000000-count-one": "0B", + "1000000000-count-other": "0B", + "10000000000-count-one": "00B", + "10000000000-count-other": "00B", + "100000000000-count-one": "000B", + "100000000000-count-other": "000B", + "1000000000000-count-one": "0T", + "1000000000000-count-other": "0T", + "10000000000000-count-one": "00T", + "10000000000000-count-other": "00T", + "100000000000000-count-one": "000T", + "100000000000000-count-other": "000T" + } + } + }, + "scientificFormats-numberSystem-latn": { + "standard": "#E0" + }, + "percentFormats-numberSystem-latn": { + "standard": "#,##0%" + }, + "currencyFormats-numberSystem-latn": { + "currencySpacing": { + "beforeCurrency": { + "currencyMatch": "[:^S:]", + "surroundingMatch": "[:digit:]", + "insertBetween": " " + }, + "afterCurrency": { + "currencyMatch": "[:^S:]", + "surroundingMatch": "[:digit:]", + "insertBetween": " " + } + }, + "accounting": "¤#,##0.00;(¤#,##0.00)", + "standard": "¤#,##0.00", + "unitPattern-count-one": "{0} {1}", + "unitPattern-count-other": "{0} {1}" + }, + "miscPatterns-numberSystem-latn": { + "atLeast": "{0}+", + "range": "{0}–{1}" + } + }, "dates": { "calendars": { "gregorian": { @@ -1235,6 +1895,7 @@ Globalize.load({ "medium": "{1}, {0}", "short": "{1}, {0}", "availableFormats": { + "E": "ccc", "EHm": "E HH:mm", "EHms": "E HH:mm:ss", "Ed": "d E", @@ -1247,6 +1908,8 @@ Globalize.load({ "H": "HH", "Hm": "HH:mm", "Hms": "HH:mm:ss", + "Hmsv": "HH:mm:ss v", + "Hmv": "HH:mm v", "M": "L", "MEd": "E, M/d", "MMM": "LLL", @@ -1257,6 +1920,8 @@ Globalize.load({ "h": "h a", "hm": "h:mm a", "hms": "h:mm:ss a", + "hmsv": "h:mm:ss a v", + "hmv": "h:mm a v", "ms": "mm:ss", "y": "y", "yM": "M/y", @@ -1389,11 +2054,11 @@ Globalize.load({ "de": { "identity": { "version": { - "_cldrVersion": "25", - "_number": "$Revision: 91 $" + "_cldrVersion": "27.0.1", + "_number": "$Revision: 11304 $" }, "generation": { - "_date": "$Date: 2014-03-13 22:27:12 -0500 (Thu, 13 Mar 2014) $" + "_date": "$Date: 2015-02-24 11:35:18 -0600 (Tue, 24 Feb 2015) $" }, "language": "de" }, @@ -1619,13 +2284,13 @@ Globalize.load({ "evening": "abends", "morning": "vormittags", "night": "nachts", - "noon": "Mittag", + "noon": "mittags", "pm": "nachm." }, "narrow": { - "am": "a", - "noon": "n", - "pm": "p" + "am": "vm.", + "noon": "m.", + "pm": "nm." }, "wide": { "afternoon": "nachmittags", @@ -1634,7 +2299,7 @@ Globalize.load({ "evening": "abends", "morning": "vormittags", "night": "nachts", - "noon": "Mittag", + "noon": "mittags", "pm": "nachm." } }, @@ -1646,22 +2311,22 @@ Globalize.load({ "evening": "abends", "morning": "vormittags", "night": "nachts", - "noon": "Mittag", + "noon": "mittags", "pm": "nachm." }, "narrow": { - "am": "a", - "noon": "n", - "pm": "p" + "am": "vm.", + "noon": "m.", + "pm": "nm." }, "wide": { - "afternoon": "Nachmittag", + "afternoon": "nachmittags", "am": "vorm.", - "earlyMorning": "Morgen", - "evening": "Abend", - "morning": "Vormittag", - "night": "Nacht", - "noon": "Mittag", + "earlyMorning": "morgens", + "evening": "abends", + "morning": "vormittags", + "night": "nachts", + "noon": "mittags", "pm": "nachm." } } @@ -1669,9 +2334,9 @@ Globalize.load({ "eras": { "eraNames": { "0": "v. Chr.", - "0-alt-variant": "vor der gewöhnlichen Zeitrechnung", + "0-alt-variant": "vor unserer Zeitrechnung", "1": "n. Chr.", - "1-alt-variant": "der gewöhnlichen Zeitrechnung" + "1-alt-variant": "unserer Zeitrechnung" }, "eraAbbr": { "0": "v. Chr.", @@ -1681,9 +2346,9 @@ Globalize.load({ }, "eraNarrow": { "0": "v. Chr.", - "0-alt-variant": "vdZ", + "0-alt-variant": "v. u. Z.", "1": "n. Chr.", - "1-alt-variant": "dZ" + "1-alt-variant": "u. Z." } }, "dateFormats": { @@ -1699,11 +2364,12 @@ Globalize.load({ "short": "HH:mm" }, "dateTimeFormats": { - "full": "{1} {0}", - "long": "{1} {0}", - "medium": "{1} {0}", - "short": "{1} {0}", + "full": "{1} 'um' {0}", + "long": "{1} 'um' {0}", + "medium": "{1}, {0}", + "short": "{1}, {0}", "availableFormats": { + "E": "ccc", "EHm": "E, HH:mm", "EHms": "E, HH:mm:ss", "Ed": "E, d.", @@ -1716,6 +2382,8 @@ Globalize.load({ "H": "HH 'Uhr'", "Hm": "HH:mm", "Hms": "HH:mm:ss", + "Hmsv": "HH:mm:ss v", + "Hmv": "HH:mm v", "M": "L", "MEd": "E, d.M.", "MMM": "LLL", @@ -1729,6 +2397,8 @@ Globalize.load({ "h": "h a", "hm": "h:mm a", "hms": "h:mm:ss a", + "hmsv": "h:mm:ss a v", + "hmv": "h:mm a v", "ms": "mm:ss", "y": "y", "yM": "M.y", @@ -1757,106 +2427,214 @@ Globalize.load({ "Year": "{1} {0}" }, "intervalFormats": { - "intervalFormatFallback": "{0} - {1}", + "intervalFormatFallback": "{0} – {1}", "H": { - "H": "HH-HH 'Uhr'" + "H": "HH–HH 'Uhr'" }, "Hm": { - "H": "HH:mm-HH:mm", - "m": "HH:mm-HH:mm" + "H": "HH:mm–HH:mm", + "m": "HH:mm–HH:mm" }, "Hmv": { - "H": "HH:mm-HH:mm v", - "m": "HH:mm-HH:mm v" + "H": "HH:mm–HH:mm v", + "m": "HH:mm–HH:mm v" }, "Hv": { - "H": "HH-HH 'Uhr' v" + "H": "HH–HH 'Uhr' v" }, "M": { - "M": "M.-M." + "M": "M.–M." }, "MEd": { - "M": "E, dd.MM. - E, dd.MM.", - "d": "E, dd.MM. - E, dd.MM." + "M": "E, dd.MM. – E, dd.MM.", + "d": "E, dd.MM. – E, dd.MM." }, "MMM": { - "M": "MMM-MMM" + "M": "MMM–MMM" }, "MMMEd": { - "M": "E, d. MMM - E, d. MMM", - "d": "E, d. - E, d. MMM" + "M": "E, d. MMM – E, d. MMM", + "d": "E, d. – E, d. MMM" }, "MMMM": { - "M": "LLLL-LLLL" + "M": "LLLL–LLLL" }, "MMMd": { - "M": "d. MMM - d. MMM", - "d": "d.-d. MMM" + "M": "d. MMM – d. MMM", + "d": "d.–d. MMM" }, "Md": { - "M": "dd.MM. - dd.MM.", - "d": "dd.MM. - dd.MM." + "M": "dd.MM. – dd.MM.", + "d": "dd.MM. – dd.MM." }, "d": { - "d": "d.-d." + "d": "d.–d." }, "h": { - "a": "h a - h a", - "h": "h-h a" + "a": "h a – h a", + "h": "h–h a" }, "hm": { - "a": "h:mm a - h:mm a", - "h": "h:mm-h:mm a", - "m": "h:mm-h:mm a" + "a": "h:mm a – h:mm a", + "h": "h:mm–h:mm a", + "m": "h:mm–h:mm a" }, "hmv": { - "a": "h:mm a - h:mm a v", - "h": "h:mm-h:mm a v", - "m": "h:mm-h:mm a v" + "a": "h:mm a – h:mm a v", + "h": "h:mm–h:mm a v", + "m": "h:mm–h:mm a v" }, "hv": { - "a": "h a - h a v", - "h": "h-h a v" + "a": "h a – h a v", + "h": "h–h a v" }, "y": { - "y": "y-y" + "y": "y–y" }, "yM": { - "M": "MM.y - MM.y", - "y": "MM.y - MM.y" + "M": "MM.y – MM.y", + "y": "MM.y – MM.y" }, "yMEd": { - "M": "E, dd.MM.y - E, dd.MM.y", - "d": "E, dd.MM.y - E, dd.MM.y", - "y": "E, dd.MM.y - E, dd.MM.y" + "M": "E, dd.MM.y – E, dd.MM.y", + "d": "E, dd.MM.y – E, dd.MM.y", + "y": "E, dd.MM.y – E, dd.MM.y" }, "yMMM": { - "M": "MMM-MMM y", - "y": "MMM y - MMM y" + "M": "MMM–MMM y", + "y": "MMM y – MMM y" }, "yMMMEd": { - "M": "E, d. MMM - E, d. MMM y", - "d": "E, d. - E, d. MMM y", - "y": "E, d. MMM y - E, d. MMM y" + "M": "E, d. MMM – E, d. MMM y", + "d": "E, d. – E, d. MMM y", + "y": "E, d. MMM y – E, d. MMM y" }, "yMMMM": { - "M": "MMMM-MMMM y", - "y": "MMMM y - MMMM y" + "M": "MMMM–MMMM y", + "y": "MMMM y – MMMM y" }, "yMMMd": { - "M": "d. MMM - d. MMM y", - "d": "d.-d. MMM y", - "y": "d. MMM y - d. MMM y" + "M": "d. MMM – d. MMM y", + "d": "d.–d. MMM y", + "y": "d. MMM y – d. MMM y" }, "yMd": { - "M": "dd.MM.y - dd.MM.y", - "d": "dd.MM.y - dd.MM.y", - "y": "dd.MM.y - dd.MM.y" + "M": "dd.MM.y – dd.MM.y", + "d": "dd.MM.y – dd.MM.y", + "y": "dd.MM.y – dd.MM.y" } } } } } + }, + "numbers": { + "defaultNumberingSystem": "latn", + "otherNumberingSystems": { + "native": "latn" + }, + "minimumGroupingDigits": "1", + "symbols-numberSystem-latn": { + "decimal": ",", + "group": ".", + "list": ";", + "percentSign": "%", + "plusSign": "+", + "minusSign": "-", + "exponential": "E", + "superscriptingExponent": "·", + "perMille": "‰", + "infinity": "∞", + "nan": "NaN", + "timeSeparator": ":" + }, + "decimalFormats-numberSystem-latn": { + "standard": "#,##0.###", + "long": { + "decimalFormat": { + "1000-count-one": "0 Tausend", + "1000-count-other": "0 Tausend", + "10000-count-one": "00 Tausend", + "10000-count-other": "00 Tausend", + "100000-count-one": "000 Tausend", + "100000-count-other": "000 Tausend", + "1000000-count-one": "0 Million", + "1000000-count-other": "0 Millionen", + "10000000-count-one": "00 Millionen", + "10000000-count-other": "00 Millionen", + "100000000-count-one": "000 Millionen", + "100000000-count-other": "000 Millionen", + "1000000000-count-one": "0 Milliarde", + "1000000000-count-other": "0 Milliarden", + "10000000000-count-one": "00 Milliarden", + "10000000000-count-other": "00 Milliarden", + "100000000000-count-one": "000 Milliarden", + "100000000000-count-other": "000 Milliarden", + "1000000000000-count-one": "0 Billion", + "1000000000000-count-other": "0 Billionen", + "10000000000000-count-one": "00 Billionen", + "10000000000000-count-other": "00 Billionen", + "100000000000000-count-one": "000 Billionen", + "100000000000000-count-other": "000 Billionen" + } + }, + "short": { + "decimalFormat": { + "1000-count-one": "0 Tsd'.'", + "1000-count-other": "0 Tsd'.'", + "10000-count-one": "00 Tsd'.'", + "10000-count-other": "00 Tsd'.'", + "100000-count-one": "000 Tsd'.'", + "100000-count-other": "000 Tsd'.'", + "1000000-count-one": "0 Mio'.'", + "1000000-count-other": "0 Mio'.'", + "10000000-count-one": "00 Mio'.'", + "10000000-count-other": "00 Mio'.'", + "100000000-count-one": "000 Mio'.'", + "100000000-count-other": "000 Mio'.'", + "1000000000-count-one": "0 Mrd'.'", + "1000000000-count-other": "0 Mrd'.'", + "10000000000-count-one": "00 Mrd'.'", + "10000000000-count-other": "00 Mrd'.'", + "100000000000-count-one": "000 Mrd'.'", + "100000000000-count-other": "000 Mrd'.'", + "1000000000000-count-one": "0 Bio'.'", + "1000000000000-count-other": "0 Bio'.'", + "10000000000000-count-one": "00 Bio'.'", + "10000000000000-count-other": "00 Bio'.'", + "100000000000000-count-one": "000 Bio'.'", + "100000000000000-count-other": "000 Bio'.'" + } + } + }, + "scientificFormats-numberSystem-latn": { + "standard": "#E0" + }, + "percentFormats-numberSystem-latn": { + "standard": "#,##0 %" + }, + "currencyFormats-numberSystem-latn": { + "currencySpacing": { + "beforeCurrency": { + "currencyMatch": "[:^S:]", + "surroundingMatch": "[:digit:]", + "insertBetween": " " + }, + "afterCurrency": { + "currencyMatch": "[:^S:]", + "surroundingMatch": "[:digit:]", + "insertBetween": " " + } + }, + "accounting": "#,##0.00 ¤", + "standard": "#,##0.00 ¤", + "unitPattern-count-one": "{0} {1}", + "unitPattern-count-other": "{0} {1}" + }, + "miscPatterns-numberSystem-latn": { + "atLeast": "{0}+", + "range": "{0}–{1}" + } } } } @@ -1867,13 +2645,13 @@ Globalize.load({ "zh": { "identity": { "version": { - "_cldrVersion": "25", - "_number": "$Revision: 91 $" + "_cldrVersion": "27.0.1", + "_number": "$Revision: 11294 $" }, "generation": { - "_date": "$Date: 2014-03-13 22:27:12 -0500 (Thu, 13 Mar 2014) $" + "_date": "$Date: 2015-02-23 16:50:24 -0600 (Mon, 23 Feb 2015) $" }, - "language": "root" + "language": "zh" }, "dates": { "calendars": { @@ -2187,8 +2965,8 @@ Globalize.load({ "short": "yy/M/d" }, "timeFormats": { - "full": "zzzzah:mm:ss", - "long": "zah:mm:ss", + "full": "zzzz ah:mm:ss", + "long": "z ah:mm:ss", "medium": "ah:mm:ss", "short": "ah:mm" }, @@ -2198,6 +2976,7 @@ Globalize.load({ "medium": "{1} {0}", "short": "{1} {0}", "availableFormats": { + "E": "ccc", "EHm": "EHH:mm", "EHms": "EHH:mm:ss", "Ed": "d日E", @@ -2210,6 +2989,8 @@ Globalize.load({ "H": "H时", "Hm": "HH:mm", "Hms": "HH:mm:ss", + "Hmsv": "v HH:mm:ss", + "Hmv": "v HH:mm", "M": "M月", "MEd": "M/dE", "MMM": "LLL", @@ -2222,9 +3003,11 @@ Globalize.load({ "h": "ah时", "hm": "ah:mm", "hms": "ah:mm:ss", + "hmsv": "v ah:mm:ss", + "hmv": "v ah:mm", "ms": "mm:ss", "y": "y年", - "yM": "y/M", + "yM": "y年M月", "yMEd": "y/M/dE", "yMM": "y年M月", "yMMM": "y年M月", @@ -2346,6 +3129,167 @@ Globalize.load({ } } } + }, + "numbers": { + "defaultNumberingSystem": "latn", + "otherNumberingSystems": { + "native": "hanidec", + "traditional": "hans", + "finance": "hansfin" + }, + "minimumGroupingDigits": "1", + "symbols-numberSystem-hanidec": { + "decimal": ".", + "group": ",", + "list": ";", + "percentSign": "%", + "plusSign": "+", + "minusSign": "-", + "exponential": "E", + "superscriptingExponent": "×", + "perMille": "‰", + "infinity": "∞", + "nan": "NaN", + "timeSeparator": ":" + }, + "symbols-numberSystem-latn": { + "decimal": ".", + "group": ",", + "list": ";", + "percentSign": "%", + "plusSign": "+", + "minusSign": "-", + "exponential": "E", + "superscriptingExponent": "×", + "perMille": "‰", + "infinity": "∞", + "nan": "NaN", + "timeSeparator": ":" + }, + "decimalFormats-numberSystem-hanidec": { + "standard": "#,##0.###", + "long": { + "decimalFormat": { + "1000-count-other": "0千", + "10000-count-other": "0万", + "100000-count-other": "00万", + "1000000-count-other": "000万", + "10000000-count-other": "0000万", + "100000000-count-other": "0亿", + "1000000000-count-other": "00亿", + "10000000000-count-other": "000亿", + "100000000000-count-other": "0000亿", + "1000000000000-count-other": "0兆", + "10000000000000-count-other": "00兆", + "100000000000000-count-other": "000兆" + } + }, + "short": { + "decimalFormat": { + "1000-count-other": "0千", + "10000-count-other": "0万", + "100000-count-other": "00万", + "1000000-count-other": "000万", + "10000000-count-other": "0000万", + "100000000-count-other": "0亿", + "1000000000-count-other": "00亿", + "10000000000-count-other": "000亿", + "100000000000-count-other": "0000亿", + "1000000000000-count-other": "0兆", + "10000000000000-count-other": "00兆", + "100000000000000-count-other": "000兆" + } + } + }, + "decimalFormats-numberSystem-latn": { + "standard": "#,##0.###", + "long": { + "decimalFormat": { + "1000-count-other": "0千", + "10000-count-other": "0万", + "100000-count-other": "00万", + "1000000-count-other": "000万", + "10000000-count-other": "0000万", + "100000000-count-other": "0亿", + "1000000000-count-other": "00亿", + "10000000000-count-other": "000亿", + "100000000000-count-other": "0000亿", + "1000000000000-count-other": "0兆", + "10000000000000-count-other": "00兆", + "100000000000000-count-other": "000兆" + } + }, + "short": { + "decimalFormat": { + "1000-count-other": "0千", + "10000-count-other": "0万", + "100000-count-other": "00万", + "1000000-count-other": "000万", + "10000000-count-other": "0000万", + "100000000-count-other": "0亿", + "1000000000-count-other": "00亿", + "10000000000-count-other": "000亿", + "100000000000-count-other": "0000亿", + "1000000000000-count-other": "0兆", + "10000000000000-count-other": "00兆", + "100000000000000-count-other": "000兆" + } + } + }, + "scientificFormats-numberSystem-hanidec": { + "standard": "#E0" + }, + "scientificFormats-numberSystem-latn": { + "standard": "#E0" + }, + "percentFormats-numberSystem-hanidec": { + "standard": "#,##0%" + }, + "percentFormats-numberSystem-latn": { + "standard": "#,##0%" + }, + "currencyFormats-numberSystem-hanidec": { + "currencySpacing": { + "beforeCurrency": { + "currencyMatch": "[:^S:]", + "surroundingMatch": "[:digit:]", + "insertBetween": " " + }, + "afterCurrency": { + "currencyMatch": "[:^S:]", + "surroundingMatch": "[:digit:]", + "insertBetween": " " + } + }, + "accounting": "¤#,##0.00;(¤#,##0.00)", + "standard": "¤ #,##0.00", + "unitPattern-count-other": "{0}{1}" + }, + "currencyFormats-numberSystem-latn": { + "currencySpacing": { + "beforeCurrency": { + "currencyMatch": "[:^S:]", + "surroundingMatch": "[:digit:]", + "insertBetween": " " + }, + "afterCurrency": { + "currencyMatch": "[:^S:]", + "surroundingMatch": "[:digit:]", + "insertBetween": " " + } + }, + "accounting": "¤#,##0.00;(¤#,##0.00)", + "standard": "¤ #,##0.00", + "unitPattern-count-other": "{0}{1}" + }, + "miscPatterns-numberSystem-hanidec": { + "atLeast": "{0}+", + "range": "{0}-{1}" + }, + "miscPatterns-numberSystem-latn": { + "atLeast": "{0}+", + "range": "{0}-{1}" + } } } } @@ -2354,26 +3298,40 @@ Globalize.load({ Globalize.load({ "supplemental": { "version": { - "_cldrVersion": "25", - "_number": "$Revision: 91 $" + "_unicodeVersion": "7.0.0", + "_number": "$Revision: 11318 $" }, "generation": { - "_date": "$Date: 2014-03-13 22:27:12 -0500 (Thu, 13 Mar 2014) $" + "_date": "$Date: 2015-02-25 23:47:56 -0600 (Wed, 25 Feb 2015) $" }, "likelySubtags": { "aa": "aa-Latn-ET", "ab": "ab-Cyrl-GE", + "abr": "abr-Latn-GH", "ace": "ace-Latn-ID", "ach": "ach-Latn-UG", + "ada": "ada-Latn-GH", "ady": "ady-Cyrl-RU", + "ae": "ae-Avst-IR", + "aeb": "aeb-Arab-TN", "af": "af-Latn-ZA", "agq": "agq-Latn-CM", "ak": "ak-Latn-GH", + "akk": "akk-Xsux-IQ", + "aln": "aln-Latn-XK", "alt": "alt-Cyrl-RU", "am": "am-Ethi-ET", "amo": "amo-Latn-NG", "aoz": "aoz-Latn-ID", "ar": "ar-Arab-EG", + "arc": "arc-Armi-IR", + "arc-Nbat": "arc-Nbat-JO", + "arc-Palm": "arc-Palm-SY", + "arn": "arn-Latn-CL", + "aro": "aro-Latn-BO", + "arq": "arq-Arab-DZ", + "ary": "ary-Arab-MA", + "arz": "arz-Arab-EG", "as": "as-Beng-IN", "asa": "asa-Latn-TZ", "ast": "ast-Latn-ES", @@ -2385,40 +3343,54 @@ Globalize.load({ "az-Arab": "az-Arab-IR", "az-IR": "az-Arab-IR", "az-RU": "az-Cyrl-RU", + "azb": "azb-Arab-IR", "ba": "ba-Cyrl-RU", "bal": "bal-Arab-PK", "ban": "ban-Latn-ID", "bap": "bap-Deva-NP", + "bar": "bar-Latn-AT", "bas": "bas-Latn-CM", "bax": "bax-Bamu-CM", "bbc": "bbc-Latn-ID", "bbj": "bbj-Latn-CM", + "bci": "bci-Latn-CI", "be": "be-Cyrl-BY", "bem": "bem-Latn-ZM", + "bew": "bew-Latn-ID", "bez": "bez-Latn-TZ", "bfd": "bfd-Latn-CM", "bfq": "bfq-Taml-IN", "bft": "bft-Arab-PK", "bfy": "bfy-Deva-IN", "bg": "bg-Cyrl-BG", + "bgc": "bgc-Deva-IN", "bgx": "bgx-Grek-TR", + "bh": "bh-Kthi-IN", "bhb": "bhb-Deva-IN", + "bhi": "bhi-Deva-IN", + "bhk": "bhk-Latn-PH", "bho": "bho-Deva-IN", "bi": "bi-Latn-VU", "bik": "bik-Latn-PH", "bin": "bin-Latn-NG", "bjj": "bjj-Deva-IN", + "bjn": "bjn-Latn-ID", "bkm": "bkm-Latn-CM", "bku": "bku-Latn-PH", + "blt": "blt-Tavt-VN", "bm": "bm-Latn-ML", "bmq": "bmq-Latn-ML", "bn": "bn-Beng-BD", "bo": "bo-Tibt-CN", + "bpy": "bpy-Beng-IN", + "bqi": "bqi-Arab-IR", "bqv": "bqv-Latn-CI", "br": "br-Latn-FR", "bra": "bra-Deva-IN", + "brh": "brh-Arab-PK", "brx": "brx-Deva-IN", "bs": "bs-Latn-BA", + "bsq": "bsq-Bass-LR", "bss": "bss-Latn-CM", "bto": "bto-Latn-PH", "btv": "btv-Deva-PK", @@ -2427,39 +3399,47 @@ Globalize.load({ "bug": "bug-Latn-ID", "bum": "bum-Latn-CM", "bvb": "bvb-Latn-GQ", - "bya": "bya-Latn-ID", "byn": "byn-Ethi-ER", "byv": "byv-Latn-CM", "bze": "bze-Latn-ML", "ca": "ca-Latn-ES", "cch": "cch-Latn-NG", "ccp": "ccp-Beng-IN", + "ccp-Cakm": "ccp-Cakm-BD", "ce": "ce-Cyrl-RU", "ceb": "ceb-Latn-PH", "cgg": "cgg-Latn-UG", "ch": "ch-Latn-GU", "chk": "chk-Latn-FM", "chm": "chm-Cyrl-RU", + "cho": "cho-Latn-US", "chp": "chp-Latn-CA", "chr": "chr-Cher-US", "cja": "cja-Arab-KH", "cjm": "cjm-Cham-VN", "ckb": "ckb-Arab-IQ", "co": "co-Latn-FR", + "cop": "cop-Copt-EG", + "cps": "cps-Latn-PH", "cr": "cr-Cans-CA", "crj": "crj-Cans-CA", "crk": "crk-Cans-CA", "crl": "crl-Cans-CA", "crm": "crm-Cans-CA", + "crs": "crs-Latn-SC", "cs": "cs-Latn-CZ", "csb": "csb-Latn-PL", "csw": "csw-Cans-CA", + "ctd": "ctd-Pauc-MM", "cu": "cu-Cyrl-RU", + "cu-Glag": "cu-Glag-BG", "cv": "cv-Cyrl-RU", "cy": "cy-Latn-GB", "da": "da-Latn-DK", + "dak": "dak-Latn-US", "dar": "dar-Cyrl-RU", "dav": "dav-Latn-KE", + "dcc": "dcc-Arab-IN", "de": "de-Latn-DE", "den": "den-Latn-CA", "dgr": "dgr-Latn-CA", @@ -2468,6 +3448,7 @@ Globalize.load({ "doi": "doi-Arab-IN", "dsb": "dsb-Latn-DE", "dtm": "dtm-Latn-ML", + "dtp": "dtp-Latn-MY", "dua": "dua-Latn-CM", "dv": "dv-Thaa-MV", "dyo": "dyo-Latn-SN", @@ -2476,16 +3457,24 @@ Globalize.load({ "ebu": "ebu-Latn-KE", "ee": "ee-Latn-GH", "efi": "efi-Latn-NG", + "egl": "egl-Latn-IT", + "egy": "egy-Egyp-EG", + "eky": "eky-Kali-MM", "el": "el-Grek-GR", "en": "en-Latn-US", + "en-Shaw": "en-Shaw-GB", "eo": "eo-Latn-001", "es": "es-Latn-ES", + "esu": "esu-Latn-US", "et": "et-Latn-EE", + "ett": "ett-Ital-IT", "eu": "eu-Latn-ES", "ewo": "ewo-Latn-CM", + "ext": "ext-Latn-ES", "fa": "fa-Arab-IR", "fan": "fan-Latn-GQ", "ff": "ff-Latn-SN", + "ffm": "ffm-Latn-ML", "fi": "fi-Latn-FI", "fil": "fil-Latn-PH", "fit": "fit-Latn-SE", @@ -2493,12 +3482,22 @@ Globalize.load({ "fo": "fo-Latn-FO", "fon": "fon-Latn-BJ", "fr": "fr-Latn-FR", + "frc": "frc-Latn-US", + "frp": "frp-Latn-FR", + "frr": "frr-Latn-DE", + "frs": "frs-Latn-DE", + "fud": "fud-Latn-WF", + "fuq": "fuq-Latn-NE", "fur": "fur-Latn-IT", + "fuv": "fuv-Latn-NG", "fy": "fy-Latn-NL", "ga": "ga-Latn-IE", "gaa": "gaa-Latn-GH", "gag": "gag-Latn-MD", + "gan": "gan-Hans-CN", + "gay": "gay-Latn-ID", "gbm": "gbm-Deva-IN", + "gbz": "gbz-Arab-IR", "gcr": "gcr-Latn-GF", "gd": "gd-Latn-GB", "gez": "gez-Ethi-ET", @@ -2507,14 +3506,21 @@ Globalize.load({ "gjk": "gjk-Arab-PK", "gju": "gju-Arab-PK", "gl": "gl-Latn-ES", + "glk": "glk-Arab-IR", "gn": "gn-Latn-PY", + "gom": "gom-Deva-IN", "gon": "gon-Telu-IN", "gor": "gor-Latn-ID", "gos": "gos-Latn-NL", + "got": "got-Goth-UA", + "grc": "grc-Cprt-CY", + "grc-Linb": "grc-Linb-GR", "grt": "grt-Beng-IN", "gsw": "gsw-Latn-CH", "gu": "gu-Gujr-IN", "gub": "gub-Latn-BR", + "guc": "guc-Latn-CO", + "gur": "gur-Latn-GH", "guz": "guz-Latn-KE", "gv": "gv-Latn-IM", "gvr": "gvr-Deva-NP", @@ -2522,27 +3528,37 @@ Globalize.load({ "ha": "ha-Latn-NG", "ha-CM": "ha-Arab-CM", "ha-SD": "ha-Arab-SD", + "hak": "hak-Hans-CN", "haw": "haw-Latn-US", + "haz": "haz-Arab-AF", "he": "he-Hebr-IL", "hi": "hi-Deva-IN", + "hif": "hif-Deva-FJ", "hil": "hil-Latn-PH", + "hmd": "hmd-Plrd-CN", "hnd": "hnd-Arab-PK", "hne": "hne-Deva-IN", + "hnj": "hnj-Hmng-LA", "hnn": "hnn-Latn-PH", + "hno": "hno-Arab-PK", "ho": "ho-Latn-PG", "hoc": "hoc-Deva-IN", "hoj": "hoj-Deva-IN", "hr": "hr-Latn-HR", "hsb": "hsb-Latn-DE", + "hsn": "hsn-Hans-CN", "ht": "ht-Latn-HT", "hu": "hu-Latn-HU", "hy": "hy-Armn-AM", + "hz": "hz-Latn-NA", "ia": "ia-Latn-FR", + "iba": "iba-Latn-MY", "ibb": "ibb-Latn-NG", "id": "id-Latn-ID", "ig": "ig-Latn-NG", "ii": "ii-Yiii-CN", "ik": "ik-Latn-US", + "ikt": "ikt-Latn-CA", "ilo": "ilo-Latn-PH", "in": "in-Latn-ID", "inh": "inh-Cyrl-RU", @@ -2550,16 +3566,20 @@ Globalize.load({ "it": "it-Latn-IT", "iu": "iu-Cans-CA", "iw": "iw-Hebr-IL", + "izh": "izh-Latn-RU", "ja": "ja-Jpan-JP", + "jam": "jam-Latn-JM", "jgo": "jgo-Latn-CM", "ji": "ji-Hebr-UA", "jmc": "jmc-Latn-TZ", "jml": "jml-Deva-NP", + "jut": "jut-Latn-DK", "jv": "jv-Latn-ID", "jw": "jw-Latn-ID", "ka": "ka-Geor-GE", "kaa": "kaa-Cyrl-UZ", "kab": "kab-Latn-DZ", + "kac": "kac-Latn-MM", "kaj": "kaj-Latn-NG", "kam": "kam-Latn-KE", "kao": "kao-Latn-ML", @@ -2572,15 +3592,18 @@ Globalize.load({ "ken": "ken-Latn-CM", "kfo": "kfo-Latn-CI", "kfr": "kfr-Deva-IN", + "kfy": "kfy-Deva-IN", "kg": "kg-Latn-CD", "kge": "kge-Latn-ID", "kgp": "kgp-Latn-BR", "kha": "kha-Latn-IN", "khb": "khb-Talu-CN", + "khn": "khn-Deva-IN", "khq": "khq-Latn-ML", "kht": "kht-Mymr-IN", "khw": "khw-Arab-PK", "ki": "ki-Latn-KE", + "kiu": "kiu-Latn-TR", "kj": "kj-Latn-NA", "kjg": "kjg-Laoo-LA", "kk": "kk-Cyrl-KZ", @@ -2602,6 +3625,7 @@ Globalize.load({ "kpe": "kpe-Latn-LR", "krc": "krc-Cyrl-RU", "kri": "kri-Latn-SL", + "krj": "krj-Latn-PH", "krl": "krl-Latn-RU", "kru": "kru-Deva-IN", "ks": "ks-Arab-IN", @@ -2616,6 +3640,7 @@ Globalize.load({ "kvr": "kvr-Latn-ID", "kvx": "kvx-Arab-PK", "kw": "kw-Latn-GB", + "kxm": "kxm-Thai-TH", "kxp": "kxp-Arab-PK", "ky": "ky-Cyrl-KG", "ky-Arab": "ky-Arab-CN", @@ -2623,8 +3648,11 @@ Globalize.load({ "ky-Latn": "ky-Latn-TR", "ky-TR": "ky-Latn-TR", "la": "la-Latn-VA", + "lab": "lab-Lina-GR", + "lad": "lad-Hebr-IL", "lag": "lag-Latn-TZ", "lah": "lah-Arab-PK", + "laj": "laj-Latn-UG", "lb": "lb-Latn-LU", "lbe": "lbe-Cyrl-RU", "lbw": "lbw-Latn-ID", @@ -2634,16 +3662,21 @@ Globalize.load({ "lg": "lg-Latn-UG", "li": "li-Latn-NL", "lif": "lif-Deva-NP", + "lif-Limb": "lif-Limb-IN", + "lij": "lij-Latn-IT", "lis": "lis-Lisu-CN", + "ljp": "ljp-Latn-ID", "lki": "lki-Arab-IR", "lkt": "lkt-Latn-US", "lmn": "lmn-Telu-IN", - "lmo": "lmo-Latn-CH", + "lmo": "lmo-Latn-IT", "ln": "ln-Latn-CD", "lo": "lo-Laoo-LA", "lol": "lol-Latn-CD", "loz": "loz-Latn-ZM", + "lrc": "lrc-Arab-IR", "lt": "lt-Latn-LT", + "ltg": "ltg-Latn-LV", "lu": "lu-Latn-CD", "lua": "lua-Latn-CD", "luo": "luo-Latn-KE", @@ -2651,6 +3684,8 @@ Globalize.load({ "luz": "luz-Arab-IR", "lv": "lv-Latn-LV", "lwl": "lwl-Thai-TH", + "lzh": "lzh-Hans-CN", + "lzz": "lzz-Latn-TR", "mad": "mad-Latn-ID", "maf": "maf-Latn-CM", "mag": "mag-Deva-IN", @@ -2666,6 +3701,7 @@ Globalize.load({ "mdr": "mdr-Latn-ID", "men": "men-Latn-SL", "mer": "mer-Latn-KE", + "mfa": "mfa-Arab-TH", "mfe": "mfe-Latn-MU", "mg": "mg-Latn-MG", "mgh": "mgh-Latn-MZ", @@ -2683,41 +3719,56 @@ Globalize.load({ "mni": "mni-Beng-IN", "mnw": "mnw-Mymr-MM", "moe": "moe-Latn-CA", + "moh": "moh-Latn-CA", "mos": "mos-Latn-BF", "mr": "mr-Deva-IN", "mrd": "mrd-Deva-NP", "mrj": "mrj-Cyrl-RU", + "mru": "mru-Mroo-BD", "ms": "ms-Latn-MY", "ms-CC": "ms-Arab-CC", "ms-ID": "ms-Arab-ID", "mt": "mt-Latn-MT", + "mtr": "mtr-Deva-IN", "mua": "mua-Latn-CM", + "mus": "mus-Latn-US", "mvy": "mvy-Arab-PK", "mwk": "mwk-Latn-ML", "mwr": "mwr-Deva-IN", + "mwv": "mwv-Latn-ID", "mxc": "mxc-Latn-ZW", "my": "my-Mymr-MM", "myv": "myv-Cyrl-RU", + "myx": "myx-Latn-UG", + "myz": "myz-Mand-IR", + "mzn": "mzn-Arab-IR", "na": "na-Latn-NR", + "nan": "nan-Hans-CN", "nap": "nap-Latn-IT", "naq": "naq-Latn-NA", "nb": "nb-Latn-NO", "nch": "nch-Latn-MX", "nd": "nd-Latn-ZW", + "ndc": "ndc-Latn-MZ", "nds": "nds-Latn-DE", "ne": "ne-Deva-NP", "new": "new-Deva-NP", "ng": "ng-Latn-NA", + "ngl": "ngl-Latn-MZ", "nhe": "nhe-Latn-MX", "nhw": "nhw-Latn-MX", "nij": "nij-Latn-ID", "niu": "niu-Latn-NU", + "njo": "njo-Latn-IN", "nl": "nl-Latn-NL", "nmg": "nmg-Latn-CM", "nn": "nn-Latn-NO", "nnh": "nnh-Latn-CM", "no": "no-Latn-NO", "nod": "nod-Lana-TH", + "noe": "noe-Deva-IN", + "non": "non-Runr-SE", + "nqo": "nqo-Nkoo-GN", "nr": "nr-Latn-ZA", "nsk": "nsk-Cans-CA", "nso": "nso-Latn-ZA", @@ -2727,31 +3778,50 @@ Globalize.load({ "ny": "ny-Latn-MW", "nym": "nym-Latn-TZ", "nyn": "nyn-Latn-UG", + "nzi": "nzi-Latn-GH", "oc": "oc-Latn-FR", "om": "om-Latn-ET", "or": "or-Orya-IN", "os": "os-Cyrl-GE", + "otk": "otk-Orkh-MN", "pa": "pa-Guru-IN", "pa-Arab": "pa-Arab-PK", "pa-PK": "pa-Arab-PK", "pag": "pag-Latn-PH", + "pal": "pal-Phli-IR", + "pal-Phlp": "pal-Phlp-CN", "pam": "pam-Latn-PH", "pap": "pap-Latn-AW", "pau": "pau-Latn-PW", + "pcd": "pcd-Latn-FR", "pcm": "pcm-Latn-NG", + "pdc": "pdc-Latn-US", + "pdt": "pdt-Latn-CA", + "peo": "peo-Xpeo-IR", + "pfl": "pfl-Latn-DE", + "phn": "phn-Phnx-LB", + "pka": "pka-Brah-IN", "pko": "pko-Latn-KE", "pl": "pl-Latn-PL", + "pms": "pms-Latn-IT", + "pnt": "pnt-Grek-GR", "pon": "pon-Latn-FM", + "pra": "pra-Khar-PK", "prd": "prd-Arab-IR", "prg": "prg-Latn-001", "ps": "ps-Arab-AF", "pt": "pt-Latn-BR", "puu": "puu-Latn-GA", "qu": "qu-Latn-PE", + "quc": "quc-Latn-GT", + "qug": "qug-Latn-EC", "raj": "raj-Latn-IN", "rcf": "rcf-Latn-RE", "rej": "rej-Latn-ID", + "rgn": "rgn-Latn-IT", "ria": "ria-Latn-IN", + "rif": "rif-Tfng-MA", + "rif-NL": "rif-Latn-NL", "rjs": "rjs-Deva-NP", "rkt": "rkt-Beng-BD", "rm": "rm-Latn-CH", @@ -2764,8 +3834,10 @@ Globalize.load({ "ro": "ro-Latn-RO", "rob": "rob-Latn-ID", "rof": "rof-Latn-TZ", + "rtm": "rtm-Latn-FJ", "ru": "ru-Cyrl-RU", "rue": "rue-Cyrl-UA", + "rug": "rug-Latn-SB", "rw": "rw-Latn-RW", "rwk": "rwk-Latn-TZ", "ryu": "ryu-Kana-JP", @@ -2777,43 +3849,57 @@ Globalize.load({ "sat": "sat-Latn-IN", "saz": "saz-Saur-IN", "sbp": "sbp-Latn-TZ", + "sc": "sc-Latn-IT", + "sck": "sck-Deva-IN", "scn": "scn-Latn-IT", "sco": "sco-Latn-GB", "scs": "scs-Latn-CA", "sd": "sd-Arab-PK", "sd-Deva": "sd-Deva-IN", - "sdh": "sdh-Arab-IR", + "sd-Khoj": "sd-Khoj-IN", + "sd-Sind": "sd-Sind-IN", + "sdc": "sdc-Latn-IT", "se": "se-Latn-NO", "sef": "sef-Latn-CI", "seh": "seh-Latn-MZ", + "sei": "sei-Latn-MX", "ses": "ses-Latn-ML", "sg": "sg-Latn-CF", + "sga": "sga-Ogam-IE", + "sgs": "sgs-Latn-LT", "shi": "shi-Tfng-MA", "shn": "shn-Mymr-MM", "si": "si-Sinh-LK", "sid": "sid-Latn-ET", "sk": "sk-Latn-SK", + "skr": "skr-Arab-PK", "sl": "sl-Latn-SI", + "sli": "sli-Latn-PL", + "sly": "sly-Latn-ID", "sm": "sm-Latn-WS", "sma": "sma-Latn-SE", "smj": "smj-Latn-SE", "smn": "smn-Latn-FI", + "smp": "smp-Samr-IL", "sms": "sms-Latn-FI", "sn": "sn-Latn-ZW", "snk": "snk-Latn-ML", "so": "so-Latn-SO", + "sou": "sou-Thai-TH", "sq": "sq-Latn-AL", "sr": "sr-Cyrl-RS", "sr-ME": "sr-Latn-ME", "sr-RO": "sr-Latn-RO", "sr-RU": "sr-Latn-RU", "sr-TR": "sr-Latn-TR", + "srb": "srb-Sora-IN", "srn": "srn-Latn-SR", "srr": "srr-Latn-SN", "srx": "srx-Deva-IN", "ss": "ss-Latn-ZA", "ssy": "ssy-Latn-ER", "st": "st-Latn-ZA", + "stq": "stq-Latn-DE", "su": "su-Latn-ID", "suk": "suk-Latn-TZ", "sus": "sus-Latn-GN", @@ -2821,9 +3907,11 @@ Globalize.load({ "sw": "sw-Latn-TZ", "swb": "swb-Arab-YT", "swc": "swc-Latn-CD", + "swv": "swv-Deva-IN", "sxn": "sxn-Latn-ID", "syl": "syl-Beng-BD", "syr": "syr-Syrc-IQ", + "szl": "szl-Latn-PL", "ta": "ta-Taml-IN", "taj": "taj-Deva-NP", "tbw": "tbw-Latn-PH", @@ -2847,21 +3935,27 @@ Globalize.load({ "tiv": "tiv-Latn-NG", "tk": "tk-Latn-TM", "tkl": "tkl-Latn-TK", + "tkr": "tkr-Latn-AZ", "tkt": "tkt-Deva-NP", "tl": "tl-Latn-PH", + "tly": "tly-Latn-AZ", "tmh": "tmh-Latn-NE", "tn": "tn-Latn-ZA", "to": "to-Latn-TO", + "tog": "tog-Latn-MW", "tpi": "tpi-Latn-PG", "tr": "tr-Latn-TR", + "tru": "tru-Latn-TR", "trv": "trv-Latn-TW", "ts": "ts-Latn-ZA", + "tsd": "tsd-Grek-GR", "tsf": "tsf-Deva-NP", "tsg": "tsg-Latn-PH", "tsj": "tsj-Tibt-BT", "tt": "tt-Cyrl-RU", "ttj": "ttj-Latn-UG", "tts": "tts-Thai-TH", + "ttt": "ttt-Latn-AZ", "tum": "tum-Latn-MW", "tvl": "tvl-Latn-TV", "twq": "twq-Latn-NE", @@ -2873,6 +3967,7 @@ Globalize.load({ "ug-Cyrl": "ug-Cyrl-KZ", "ug-KZ": "ug-Cyrl-KZ", "ug-MN": "ug-Cyrl-MN", + "uga": "uga-Ugar-SY", "uk": "uk-Cyrl-UA", "uli": "uli-Latn-FM", "umb": "umb-Latn-AO", @@ -2883,7 +3978,7 @@ Globalize.load({ "und-009": "en-Latn-AU", "und-011": "en-Latn-NG", "und-013": "es-Latn-MX", - "und-014": "en-Latn-KE", + "und-014": "sw-Latn-TZ", "und-015": "ar-Arab-EG", "und-017": "sw-Latn-CD", "und-018": "en-Latn-ZA", @@ -2896,7 +3991,7 @@ Globalize.load({ "und-039": "it-Latn-IT", "und-053": "en-Latn-AU", "und-054": "en-Latn-PG", - "und-057": "en-Latn-KI", + "und-057": "en-Latn-GU", "und-061": "sm-Latn-WS", "und-142": "zh-Hans-CN", "und-143": "uz-Latn-UZ", @@ -2919,6 +4014,7 @@ Globalize.load({ "und-AW": "nl-Latn-AW", "und-AX": "sv-Latn-AX", "und-AZ": "az-Latn-AZ", + "und-Aghb": "lez-Aghb-RU", "und-Arab": "ar-Arab-EG", "und-Arab-CC": "ms-Arab-CC", "und-Arab-CN": "ug-Arab-CN", @@ -2930,8 +4026,8 @@ Globalize.load({ "und-Arab-MU": "ur-Arab-MU", "und-Arab-NG": "ha-Arab-NG", "und-Arab-PK": "ur-Arab-PK", + "und-Arab-TH": "mfa-Arab-TH", "und-Arab-TJ": "fa-Arab-TJ", - "und-Arab-TR": "zza-Arab-TR", "und-Arab-YT": "swb-Arab-YT", "und-Armi": "arc-Armi-IR", "und-Armn": "hy-Armn-AM", @@ -2954,11 +4050,12 @@ Globalize.load({ "und-BY": "be-Cyrl-BY", "und-Bali": "ban-Bali-ID", "und-Bamu": "bax-Bamu-CM", + "und-Bass": "bsq-Bass-LR", "und-Batk": "bbc-Batk-ID", "und-Beng": "bn-Beng-BD", "und-Bopo": "zh-Bopo-TW", - "und-Brah": "pra-Brah-IN", - "und-Brai": "und-Brai-FR", + "und-Brah": "pka-Brah-IN", + "und-Brai": "fr-Brai-FR", "und-Bugi": "bug-Bugi-ID", "und-Buhd": "bku-Buhd-PH", "und-CD": "sw-Latn-CD", @@ -3002,8 +4099,10 @@ Globalize.load({ "und-DZ": "ar-Arab-DZ", "und-Deva": "hi-Deva-IN", "und-Deva-BT": "ne-Deva-BT", + "und-Deva-FJ": "hif-Deva-FJ", "und-Deva-MU": "bho-Deva-MU", "und-Deva-PK": "btv-Deva-PK", + "und-Dupl": "fr-Dupl-FR", "und-EA": "es-Latn-EA", "und-EC": "es-Latn-EC", "und-EE": "et-Latn-EE", @@ -3014,9 +4113,9 @@ Globalize.load({ "und-ET": "am-Ethi-ET", "und-EU": "en-Latn-GB", "und-Egyp": "egy-Egyp-EG", + "und-Elba": "sq-Elba-AL", "und-Ethi": "am-Ethi-ET", "und-FI": "fi-Latn-FI", - "und-FM": "chk-Latn-FM", "und-FO": "fo-Latn-FO", "und-FR": "fr-Latn-FR", "und-GA": "fr-Latn-GA", @@ -3034,6 +4133,7 @@ Globalize.load({ "und-Geor": "ka-Geor-GE", "und-Glag": "cu-Glag-BG", "und-Goth": "got-Goth-UA", + "und-Gran": "sa-Gran-IN", "und-Grek": "el-Grek-GR", "und-Grek-TR": "bgx-Grek-TR", "und-Gujr": "gu-Gujr-IN", @@ -3056,6 +4156,7 @@ Globalize.load({ "und-Hebr-UA": "yi-Hebr-UA", "und-Hebr-US": "yi-Hebr-US", "und-Hira": "ja-Hira-JP", + "und-Hmng": "hnj-Hmng-LA", "und-IC": "es-Latn-IC", "und-ID": "id-Latn-ID", "und-IL": "he-Hebr-IL", @@ -3069,6 +4170,7 @@ Globalize.load({ "und-JP": "ja-Jpan-JP", "und-Java": "jv-Java-ID", "und-Jpan": "ja-Jpan-JP", + "und-KE": "sw-Latn-KE", "und-KG": "ky-Cyrl-KG", "und-KH": "km-Khmr-KH", "und-KM": "ar-Arab-KM", @@ -3080,6 +4182,7 @@ Globalize.load({ "und-Kana": "ja-Kana-JP", "und-Khar": "pra-Khar-PK", "und-Khmr": "km-Khmr-KH", + "und-Khoj": "sd-Khoj-IN", "und-Knda": "kn-Knda-IN", "und-Kore": "ko-Kore-KR", "und-Kthi": "bh-Kthi-IN", @@ -3095,21 +4198,17 @@ Globalize.load({ "und-Lana": "nod-Lana-TH", "und-Laoo": "lo-Laoo-LA", "und-Latn-AF": "tk-Latn-AF", - "und-Latn-AM": "az-Latn-AM", - "und-Latn-BG": "tr-Latn-BG", + "und-Latn-AM": "ku-Latn-AM", "und-Latn-CN": "za-Latn-CN", "und-Latn-CY": "tr-Latn-CY", "und-Latn-DZ": "fr-Latn-DZ", "und-Latn-ET": "en-Latn-ET", "und-Latn-GE": "ku-Latn-GE", - "und-Latn-GR": "tr-Latn-GR", - "und-Latn-IL": "ro-Latn-IL", "und-Latn-IR": "tk-Latn-IR", "und-Latn-KM": "fr-Latn-KM", - "und-Latn-KZ": "de-Latn-KZ", - "und-Latn-LB": "fr-Latn-LB", "und-Latn-MA": "fr-Latn-MA", "und-Latn-MK": "sq-Latn-MK", + "und-Latn-MM": "kac-Latn-MM", "und-Latn-MO": "pt-Latn-MO", "und-Latn-MR": "fr-Latn-MR", "und-Latn-RU": "krl-Latn-RU", @@ -3119,6 +4218,7 @@ Globalize.load({ "und-Latn-UA": "pl-Latn-UA", "und-Lepc": "lep-Lepc-IN", "und-Limb": "lif-Limb-IN", + "und-Lina": "lab-Lina-GR", "und-Linb": "grc-Linb-GR", "und-Lisu": "lis-Lisu-CN", "und-Lyci": "xlc-Lyci-TR", @@ -3142,11 +4242,16 @@ Globalize.load({ "und-MX": "es-Latn-MX", "und-MY": "ms-Latn-MY", "und-MZ": "pt-Latn-MZ", + "und-Mahj": "hi-Mahj-IN", "und-Mand": "myz-Mand-IR", + "und-Mani": "xmn-Mani-CN", + "und-Mend": "men-Mend-SL", "und-Merc": "xmr-Merc-SD", "und-Mero": "xmr-Mero-SD", "und-Mlym": "ml-Mlym-IN", + "und-Modi": "mr-Modi-IN", "und-Mong": "mn-Mong-CN", + "und-Mroo": "mru-Mroo-BD", "und-Mtei": "mni-Mtei-IN", "und-Mymr": "my-Mymr-MM", "und-Mymr-IN": "kht-Mymr-IN", @@ -3158,6 +4263,8 @@ Globalize.load({ "und-NL": "nl-Latn-NL", "und-NO": "nb-Latn-NO", "und-NP": "ne-Deva-NP", + "und-Narb": "xna-Narb-SA", + "und-Nbat": "arc-Nbat-JO", "und-Nkoo": "man-Nkoo-GN", "und-OM": "ar-Arab-OM", "und-Ogam": "sga-Ogam-IE", @@ -3178,8 +4285,12 @@ Globalize.load({ "und-PT": "pt-Latn-PT", "und-PW": "pau-Latn-PW", "und-PY": "gn-Latn-PY", + "und-Palm": "arc-Palm-SY", + "und-Pauc": "ctd-Pauc-MM", + "und-Perm": "kv-Perm-RU", "und-Phag": "lzh-Phag-CN", "und-Phli": "pal-Phli-IR", + "und-Phlp": "pal-Phlp-CN", "und-Phnx": "phn-Phnx-LB", "und-Plrd": "hmd-Plrd-CN", "und-Prti": "xpr-Prti-IR", @@ -3211,6 +4322,8 @@ Globalize.load({ "und-Saur": "saz-Saur-IN", "und-Shaw": "en-Shaw-GB", "und-Shrd": "sa-Shrd-IN", + "und-Sidd": "sa-Sidd-IN", + "und-Sind": "sd-Sind-IN", "und-Sinh": "si-Sinh-LK", "und-Sora": "srb-Sora-IN", "und-Sund": "su-Sund-ID", @@ -3245,24 +4358,27 @@ Globalize.load({ "und-Thai-KH": "kdt-Thai-KH", "und-Thai-LA": "kdt-Thai-LA", "und-Tibt": "bo-Tibt-CN", + "und-Tirh": "mai-Tirh-IN", "und-UA": "uk-Cyrl-UA", "und-UG": "sw-Latn-UG", "und-UY": "es-Latn-UY", "und-UZ": "uz-Latn-UZ", "und-Ugar": "uga-Ugar-SY", - "und-VA": "la-Latn-VA", + "und-VA": "it-Latn-VA", "und-VE": "es-Latn-VE", "und-VN": "vi-Latn-VN", "und-VU": "bi-Latn-VU", "und-Vaii": "vai-Vaii-LR", "und-WF": "fr-Latn-WF", "und-WS": "sm-Latn-WS", + "und-Wara": "hoc-Wara-IN", "und-XK": "sq-Latn-XK", "und-Xpeo": "peo-Xpeo-IR", "und-Xsux": "akk-Xsux-IQ", "und-YE": "ar-Arab-YE", "und-YT": "fr-Latn-YT", "und-Yiii": "ii-Yiii-CN", + "und-ZW": "sn-Latn-ZW", "unr": "unr-Beng-IN", "unr-Deva": "unr-Deva-NP", "unr-NP": "unr-Deva-NP", @@ -3274,32 +4390,58 @@ Globalize.load({ "uz-CN": "uz-Cyrl-CN", "vai": "vai-Vaii-LR", "ve": "ve-Latn-ZA", + "vec": "vec-Latn-IT", + "vep": "vep-Latn-RU", "vi": "vi-Latn-VN", "vic": "vic-Latn-SX", + "vls": "vls-Latn-BE", + "vmf": "vmf-Latn-DE", + "vmw": "vmw-Latn-MZ", "vo": "vo-Latn-001", + "vot": "vot-Latn-RU", + "vro": "vro-Latn-EE", "vun": "vun-Latn-TZ", "wa": "wa-Latn-BE", "wae": "wae-Latn-CH", "wal": "wal-Ethi-ET", "war": "war-Latn-PH", + "wbp": "wbp-Latn-AU", + "wbq": "wbq-Telu-IN", + "wbr": "wbr-Deva-IN", + "wls": "wls-Latn-WF", "wo": "wo-Latn-SN", + "wtm": "wtm-Deva-IN", + "wuu": "wuu-Hans-CN", "xav": "xav-Latn-BR", + "xcr": "xcr-Cari-TR", "xh": "xh-Latn-ZA", + "xlc": "xlc-Lyci-TR", + "xld": "xld-Lydi-TR", + "xmf": "xmf-Geor-GE", + "xmn": "xmn-Mani-CN", + "xmr": "xmr-Merc-SD", + "xna": "xna-Narb-SA", + "xnr": "xnr-Deva-IN", "xog": "xog-Latn-UG", + "xpr": "xpr-Prti-IR", + "xsa": "xsa-Sarb-YE", "xsr": "xsr-Deva-NP", "yao": "yao-Latn-MZ", "yap": "yap-Latn-FM", "yav": "yav-Latn-CM", "ybb": "ybb-Latn-CM", - "yi": "yi-Hebr-UA", + "yi": "yi-Hebr-001", "yo": "yo-Latn-NG", + "yrl": "yrl-Latn-BR", "yua": "yua-Latn-MX", "za": "za-Latn-CN", + "zdj": "zdj-Arab-KM", "zea": "zea-Latn-NL", "zgh": "zgh-Tfng-MA", "zh": "zh-Hans-CN", "zh-AU": "zh-Hant-AU", "zh-BN": "zh-Hant-BN", + "zh-Bopo": "zh-Bopo-TW", "zh-GB": "zh-Hant-GB", "zh-GF": "zh-Hant-GF", "zh-HK": "zh-Hant-HK", @@ -3317,7 +4459,7 @@ Globalize.load({ "zh-VN": "zh-Hant-VN", "zmi": "zmi-Latn-MY", "zu": "zu-Latn-ZA", - "zza": "zza-Arab-TR" + "zza": "zza-Latn-TR" } } }); @@ -3325,11 +4467,11 @@ Globalize.load({ Globalize.load({ "supplemental": { "version": { - "_cldrVersion": "25", - "_number": "$Revision: 91 $" + "_unicodeVersion": "7.0.0", + "_number": "$Revision: 11318 $" }, "generation": { - "_date": "$Date: 2014-03-13 22:27:12 -0500 (Thu, 13 Mar 2014) $" + "_date": "$Date: 2015-02-25 23:47:56 -0600 (Wed, 25 Feb 2015) $" }, "timeData": { "001": { @@ -3416,6 +4558,10 @@ Globalize.load({ "_allowed": "H h", "_preferred": "h" }, + "BQ": { + "_allowed": "H", + "_preferred": "H" + }, "BR": { "_allowed": "H", "_preferred": "H" @@ -3440,6 +4586,10 @@ Globalize.load({ "_allowed": "H", "_preferred": "H" }, + "CG": { + "_allowed": "H", + "_preferred": "H" + }, "CI": { "_allowed": "H", "_preferred": "H" @@ -3939,11 +5089,11 @@ Globalize.load({ Globalize.load({ "supplemental": { "version": { - "_cldrVersion": "25", - "_number": "$Revision: 91 $" + "_unicodeVersion": "7.0.0", + "_number": "$Revision: 11318 $" }, "generation": { - "_date": "$Date: 2014-03-13 22:27:12 -0500 (Thu, 13 Mar 2014) $" + "_date": "$Date: 2015-02-25 23:47:56 -0600 (Wed, 25 Feb 2015) $" }, "weekData": { "minDays": { @@ -4157,13 +5307,16 @@ Globalize.load({ "001": "sat", "AE": "fri", "BH": "fri", + "DZ": "fri", "EG": "fri", "IL": "fri", "IQ": "fri", + "IR": "fri", "JO": "fri", "KW": "fri", "LY": "fri", "MA": "fri", + "OM": "fri", "QA": "fri", "SA": "fri", "SD": "fri", @@ -4171,15 +5324,13 @@ Globalize.load({ "TN": "fri", "YE": "fri", "AF": "thu", - "DZ": "thu", - "IR": "thu", - "OM": "thu", "IN": "sun" }, "weekendEnd": { "001": "sun", "AE": "sat", "BH": "sat", + "DZ": "sat", "EG": "sat", "IL": "sat", "IQ": "sat", @@ -4187,6 +5338,7 @@ Globalize.load({ "KW": "sat", "LY": "sat", "MA": "sat", + "OM": "sat", "QA": "sat", "SA": "sat", "SD": "sat", @@ -4194,9 +5346,7 @@ Globalize.load({ "TN": "sat", "YE": "sat", "AF": "fri", - "DZ": "fri", - "IR": "fri", - "OM": "fri" + "IR": "fri" } } } diff --git a/ui/calendar.js b/ui/calendar.js index 966e4c992..6bf9c82ab 100644 --- a/ui/calendar.js +++ b/ui/calendar.js @@ -26,7 +26,8 @@ "date", "./button", "./core", - "./button" ], factory ); + "./button" + ], factory ); } else { // Browser globals @@ -178,8 +179,8 @@ return $.widget( "ui.calendar", { _setLocale: function( locale ) { var globalize = new Globalize( locale ), - weekdayShortFormatter = globalize.dateFormatter({ pattern: "EEEEEE" }), - weekdayNarrowFormatter = globalize.dateFormatter({ pattern: "EEEEE" }); + weekdayShortFormatter = globalize.dateFormatter({ raw: "EEEEEE" }), + weekdayNarrowFormatter = globalize.dateFormatter({ raw: "EEEEE" }); this._format = globalize.dateFormatter({ date: "short" }); this._parse = globalize.dateParser({ date: "short" }); @@ -192,9 +193,9 @@ return $.widget( "ui.calendar", { return shortWeekday.length > 3 ? weekdayNarrowFormatter( date ) : shortWeekday; }, - formatWeekdayFull: globalize.dateFormatter({ pattern: "EEEE" }), - formatMonth: globalize.dateFormatter({ pattern: "MMMM" }), - formatWeekOfYear: globalize.dateFormatter({ pattern: "w" }), + formatWeekdayFull: globalize.dateFormatter({ raw: "EEEE" }), + formatMonth: globalize.dateFormatter({ raw: "MMMM" }), + formatWeekOfYear: globalize.dateFormatter({ raw: "w" }), parse: this._parse }; },