Socket
Socket
Sign inDemoInstall

globalize

Package Overview
Dependencies
Maintainers
4
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

globalize - npm Package Compare versions

Comparing version 1.0.0-alpha.14 to 1.0.0-alpha.15

browserstack-ie8.json

6

bower.json
{
"name": "globalize",
"version": "1.0.0-alpha.14",
"version": "1.0.0-alpha.15",
"license": "MIT",

@@ -16,6 +16,6 @@ "ignore": [

"devDependencies": {
"es5-shim": "3.4.0",
"make-plural": "eemeli/make-plural.js#2.1.2",
"es5-shim": "3.4.0",
"messageformat": "SlexAxton/messageformat.js#debeaf4",
"qunit": "1.12.0",
"qunit": "1.16.0",
"requirejs": "2.1.9",

@@ -22,0 +22,0 @@ "requirejs-plugins": "1.0.2",

@@ -5,2 +5,2 @@ Welcome! Thanks for your interest in contributing to Globalize. You're **almost** in the right place. More information on how to contribute to this and all other jQuery Foundation projects is over at [contribute.jquery.org](http://contribute.jquery.org). You'll definitely want to take a look at the articles on contributing [code](http://contribute.jquery.org/code).

You can find us on [IRC](http://irc.jquery.org), specifically in #jqueryui-dev should you have any questions. If you've never contributed to open source before, we've put together [a short guide with tips, tricks, and ideas on getting started](http://contribute.jquery.org/open-source/).
You can find us on [IRC](http://irc.jquery.org), specifically in #globalize should you have any questions. If you've never contributed to open source before, we've put together [a short guide with tips, tricks, and ideas on getting started](http://contribute.jquery.org/open-source/).
/**
* Globalize v1.0.0-alpha.14
* Globalize v1.0.0-alpha.15
*

@@ -10,6 +10,6 @@ * http://github.com/jquery/globalize

*
* Date: 2014-12-19T17:43Z
* Date: 2015-01-13T15:01Z
*/
/*!
* Globalize v1.0.0-alpha.14 2014-12-19T17:43Z Released under the MIT license
* Globalize v1.0.0-alpha.15 2015-01-13T15:01Z Released under the MIT license
* http://git.io/TrdQbw

@@ -16,0 +16,0 @@ */

/*!
* Globalize v1.0.0-alpha.14
* Globalize v1.0.0-alpha.15
*

@@ -10,3 +10,3 @@ * http://github.com/jquery/globalize

*
* Date: 2014-12-19T17:43Z
* Date: 2015-01-13T15:01Z
*/

@@ -23,3 +23,4 @@ (function( root, factory ) {

"./number",
"cldr/event"
"cldr/event",
"cldr/supplemental"
], factory );

@@ -26,0 +27,0 @@ } else if ( typeof exports === "object" ) {

/**
* Globalize v1.0.0-alpha.14
* Globalize v1.0.0-alpha.15
*

@@ -10,6 +10,6 @@ * http://github.com/jquery/globalize

*
* Date: 2014-12-19T17:43Z
* Date: 2015-01-13T15:01Z
*/
/*!
* Globalize v1.0.0-alpha.14 2014-12-19T17:43Z Released under the MIT license
* Globalize v1.0.0-alpha.15 2015-01-13T15:01Z Released under the MIT license
* http://git.io/TrdQbw

@@ -806,2 +806,30 @@ */

/**
* 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

@@ -859,3 +887,3 @@ * day remains inside the month boundaries. For example:

var dateParse = function( value, tokens, properties ) {
var amPm, era, hour, hour12, timezoneOffset, valid,
var amPm, day, daysOfYear, era, hour, hour12, timezoneOffset, valid,
YEAR = 0,

@@ -952,7 +980,3 @@ MONTH = 1,

case "d":
value = token.value;
if ( outOfRange( value, 1, 31 ) ) {
return false;
}
dateSetDate( date, value );
day = token.value;
truncateAt.push( DAY );

@@ -962,8 +986,3 @@ break;

case "D":
value = token.value;
if ( outOfRange( value, 1, 366 ) ) {
return false;
}
date.setMonth(0);
date.setDate( value );
daysOfYear = token.value;
truncateAt.push( DAY );

@@ -1091,2 +1110,15 @@ break;

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" ) {

@@ -1093,0 +1125,0 @@ date.setHours( date.getHours() + 12 );

/**
* Globalize v1.0.0-alpha.14
* Globalize v1.0.0-alpha.15
*

@@ -10,6 +10,6 @@ * http://github.com/jquery/globalize

*
* Date: 2014-12-19T17:43Z
* Date: 2015-01-13T15:01Z
*/
/*!
* Globalize v1.0.0-alpha.14 2014-12-19T17:43Z Released under the MIT license
* Globalize v1.0.0-alpha.15 2015-01-13T15:01Z Released under the MIT license
* http://git.io/TrdQbw

@@ -16,0 +16,0 @@ */

/**
* Globalize v1.0.0-alpha.14
* Globalize v1.0.0-alpha.15
*

@@ -10,6 +10,6 @@ * http://github.com/jquery/globalize

*
* Date: 2014-12-19T17:43Z
* Date: 2015-01-13T15:01Z
*/
/*!
* Globalize v1.0.0-alpha.14 2014-12-19T17:43Z Released under the MIT license
* Globalize v1.0.0-alpha.15 2015-01-13T15:01Z Released under the MIT license
* http://git.io/TrdQbw

@@ -16,0 +16,0 @@ */

/**
* Globalize v1.0.0-alpha.14
* Globalize v1.0.0-alpha.15
*

@@ -10,6 +10,6 @@ * http://github.com/jquery/globalize

*
* Date: 2014-12-19T17:43Z
* Date: 2015-01-13T15:01Z
*/
/*!
* Globalize v1.0.0-alpha.14 2014-12-19T17:43Z Released under the MIT license
* Globalize v1.0.0-alpha.15 2015-01-13T15:01Z Released under the MIT license
* http://git.io/TrdQbw

@@ -16,0 +16,0 @@ */

/*!
* Globalize v1.0.0-alpha.14
* Globalize v1.0.0-alpha.15
*

@@ -10,3 +10,3 @@ * http://github.com/jquery/globalize

*
* Date: 2014-12-19T17:43Z
* Date: 2015-01-13T15:01Z
*/

@@ -13,0 +13,0 @@

@@ -204,3 +204,9 @@ module.exports = function( grunt ) {

include: [ "currency" ],
exclude: [ "cldr", "cldr/event", "./core", "./number" ],
exclude: [
"cldr",
"cldr/event",
"cldr/supplemental",
"./core",
"./number"
],
create: true,

@@ -217,3 +223,9 @@ override: {

include: [ "date" ],
exclude: [ "cldr", "cldr/supplemental", "./core", "./number" ],
exclude: [
"cldr",
"cldr/event",
"cldr/supplemental",
"./core",
"./number"
],
create: true,

@@ -228,9 +240,9 @@ override: {

{
name: "globalize.number",
include: [ "number" ],
exclude: [ "cldr", "cldr/event", "./core" ],
name: "globalize.message",
include: [ "message" ],
exclude: [ "cldr", "./core" ],
create: true,
override: {
wrap: {
startFile: "src/build/intro-number.js",
startFile: "src/build/intro-message.js",
endFile: "src/build/outro.js"

@@ -241,9 +253,14 @@ }

{
name: "globalize.plural",
include: [ "plural" ],
exclude: [ "cldr", "cldr/event", "cldr/supplemental", "./core" ],
name: "globalize.number",
include: [ "number" ],
exclude: [
"cldr",
"cldr/event",
"cldr/supplemental",
"./core"
],
create: true,
override: {
wrap: {
startFile: "src/build/intro-plural.js",
startFile: "src/build/intro-number.js",
endFile: "src/build/outro.js"

@@ -254,9 +271,14 @@ }

{
name: "globalize.message",
include: [ "message" ],
exclude: [ "cldr", "cldr/event", "./core" ],
name: "globalize.plural",
include: [ "plural" ],
exclude: [
"cldr",
"cldr/event",
"cldr/supplemental",
"./core"
],
create: true,
override: {
wrap: {
startFile: "src/build/intro-message.js",
startFile: "src/build/intro-plural.js",
endFile: "src/build/outro.js"

@@ -263,0 +285,0 @@ }

{
"name": "globalize",
"version": "1.0.0-alpha.14",
"version": "1.0.0-alpha.15",
"description": "A JavaScript library for internationalization and localization that leverage the official Unicode CLDR JSON data.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -22,3 +22,4 @@ /*!

"./number",
"cldr/event"
"cldr/event",
"cldr/supplemental"
], factory );

@@ -25,0 +26,0 @@ } else if ( typeof exports === "object" ) {

@@ -17,3 +17,4 @@ define([

"./number",
"cldr/event"
"cldr/event",
"cldr/supplemental"
], function( Globalize, validateCldr, validateDefaultLocale, validateParameterPresence,

@@ -20,0 +21,0 @@ validateParameterTypeNumber, validateParameterTypeCurrency, validateParameterTypePlainObject,

define([
"./is-leap-year",
"./last-day-of-month",
"./pattern-re",
"./start-of",
"../common/create-error/unsupported-feature",
"../util/date/set-date",
"../util/date/set-month",
"../util/out-of-range"
], function( datePatternRe, dateStartOf, createErrorUnsupportedFeature, dateSetDate,
dateSetMonth, outOfRange ) {
], function( dateIsLeapYear, dateLastDayOfMonth, datePatternRe, dateStartOf,
createErrorUnsupportedFeature, dateSetMonth, outOfRange ) {

@@ -23,3 +24,3 @@ /**

return function( value, tokens, properties ) {
var amPm, era, hour, hour12, timezoneOffset, valid,
var amPm, day, daysOfYear, era, hour, hour12, timezoneOffset, valid,
YEAR = 0,

@@ -116,7 +117,3 @@ MONTH = 1,

case "d":
value = token.value;
if ( outOfRange( value, 1, 31 ) ) {
return false;
}
dateSetDate( date, value );
day = token.value;
truncateAt.push( DAY );

@@ -126,8 +123,3 @@ break;

case "D":
value = token.value;
if ( outOfRange( value, 1, 366 ) ) {
return false;
}
date.setMonth(0);
date.setDate( value );
daysOfYear = token.value;
truncateAt.push( DAY );

@@ -255,2 +247,15 @@ break;

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" ) {

@@ -257,0 +262,0 @@ date.setHours( date.getHours() + 12 );

@@ -20,3 +20,4 @@ define([

"cldr/event"
"cldr/event",
"cldr/supplemental"
], function( Globalize, createErrorUnsupportedFeature, validateCldr, validateDefaultLocale,

@@ -23,0 +24,0 @@ validateParameterPresence, validateParameterRange, validateParameterTypeNumber,

@@ -11,2 +11,3 @@ define([

"cldr/event",
"cldr/supplemental"

@@ -13,0 +14,0 @@ ], function( Cldr, MakePlural, Globalize, validateCldr, validateDefaultLocale,

@@ -9,3 +9,6 @@ require.config({

text: "../external/requirejs-text/text"
}
},
// Increase the default of 7 seconds for high-latency envs like browserstack-runner.
waitSeconds: 30
});

@@ -43,3 +46,8 @@

QUnit.start();
}, function( error ) {
QUnit.test( "requirejs load failure", function( assert ) {
assert.ok( false, "requirejs failed to load: " + QUnit.jsDump.parse( error ) );
});
QUnit.start();
});

@@ -7,3 +7,2 @@ define([

"cldr/event",
"globalize/message",

@@ -10,0 +9,0 @@ "globalize/plural"

@@ -7,3 +7,2 @@ define([

"cldr/event",
"cldr/unresolved",

@@ -10,0 +9,0 @@ "globalize/message",

@@ -8,3 +8,6 @@ require.config({

text: "../external/requirejs-text/text"
}
},
// Increase the default of 7 seconds for high-latency envs like browserstack-runner.
waitSeconds: 30
});

@@ -49,2 +52,7 @@

QUnit.start();
}, function( error ) {
QUnit.test( "requirejs load failure", function( assert ) {
assert.ok( false, "requirejs failed to load: " + QUnit.jsDump.parse( error ) );
});
QUnit.start();
});
define([
"cldr",
"src/core",
"json!cldr-data/supplemental/likelySubtags.json"
"json!cldr-data/supplemental/likelySubtags.json",
"cldr/event"
], function( Cldr, Globalize, likelySubtags ) {

@@ -6,0 +8,0 @@

@@ -8,3 +8,6 @@ define([

"json!cldr-data/supplemental/currencyData.json",
"json!cldr-data/supplemental/likelySubtags.json"
"json!cldr-data/supplemental/likelySubtags.json",
"cldr/event",
"cldr/supplemental"
], function( Cldr, properties, deNumbers, enNumbers, zhNumbers, currencyData, likelySubtags ) {

@@ -11,0 +14,0 @@

@@ -10,3 +10,6 @@ define([

"json!cldr-data/supplemental/currencyData.json",
"json!cldr-data/supplemental/likelySubtags.json"
"json!cldr-data/supplemental/likelySubtags.json",
"cldr/event",
"cldr/supplemental"
], function( Cldr, format, properties, enCurrencies, enNumbers, zhCurrencies, zhNumbers,

@@ -13,0 +16,0 @@ currencyData, likelySubtags ) {

@@ -11,3 +11,6 @@ define([

"json!cldr-data/supplemental/currencyData.json",
"json!cldr-data/supplemental/likelySubtags.json"
"json!cldr-data/supplemental/likelySubtags.json",
"cldr/event",
"cldr/supplemental"
], function( Cldr, properties, deCurrencies, deNumbers, enCurrencies, enNumbers, zhCurrencies,

@@ -14,0 +17,0 @@ zhNumbers, currencyData, likelySubtags ) {

@@ -11,3 +11,6 @@ define([

"json!cldr-data/supplemental/currencyData.json",
"json!cldr-data/supplemental/likelySubtags.json"
"json!cldr-data/supplemental/likelySubtags.json",
"cldr/event",
"cldr/supplemental"
], function( Cldr, symbolProperties, deCurrencies, deNumbers, enCurrencies, enNumbers, zhCurrencies,

@@ -14,0 +17,0 @@ zhNumbers, currencyData, likelySubtags ) {

@@ -5,3 +5,6 @@ define([

"json!cldr-data/main/en/ca-gregorian.json",
"json!cldr-data/supplemental/likelySubtags.json"
"json!cldr-data/supplemental/likelySubtags.json",
"cldr/event",
"cldr/supplemental"
], function( Cldr, expandPattern, enCaGregorian, likelySubtags ) {

@@ -8,0 +11,0 @@

@@ -9,2 +9,3 @@ define([

"cldr/event",
"cldr/supplemental"

@@ -11,0 +12,0 @@ ], function( Cldr, properties, enCaGregorian, likelySubtags, timeData, weekData ) {

@@ -12,2 +12,3 @@ define([

"cldr/event",
"cldr/supplemental"

@@ -14,0 +15,0 @@ ], function( Cldr, format, formatProperties, stringPad, enCaGregorian, timeZoneNames, likelySubtags,

@@ -8,2 +8,3 @@ define([

"cldr/event",
"cldr/supplemental"

@@ -10,0 +11,0 @@ ], function( Cldr, parseProperties, enCaGregorian, likelySubtags, timeData ) {

@@ -14,2 +14,3 @@ define([

"cldr/event",
"cldr/supplemental"

@@ -19,3 +20,3 @@ ], function( Cldr, parse, parseProperties, startOf, tokenizer, numberTokenizerProperties,

var cldr, date1, date2, midnight;
var cldr, date1, date2, FakeDate, midnight;

@@ -47,2 +48,32 @@ function assertParse( assert, stringDate, pattern, cldr, date ) {

FakeDate = (function( Date ) {
function FakeDate() {
var date;
if ( arguments.length === 0 ) {
return FakeDate.today;
}
if ( arguments.length === 1 ) {
date = new Date( arguments[ 0 ] );
} else if ( arguments.length === 2 ) {
date = new Date( arguments[ 0 ], arguments[ 1 ] );
} else if ( arguments.length === 3 ) {
date = new Date( arguments[ 0 ], arguments[ 1 ], arguments[ 2 ] );
} else if ( arguments.length === 4 ) {
date = new Date( arguments[ 0 ], arguments[ 1 ], arguments[ 2 ], arguments[ 3 ] );
} else if ( arguments.length === 5 ) {
date = new Date( arguments[ 0 ], arguments[ 1 ], arguments[ 2 ], arguments[ 3 ], arguments[ 4 ] );
} else if ( arguments.length === 6 ) {
date = new Date( arguments[ 0 ], arguments[ 1 ], arguments[ 2 ], arguments[ 3 ], arguments[ 4 ], arguments[ 5 ] );
} else if ( arguments.length === 7 ) {
date = new Date( arguments[ 0 ], arguments[ 1 ], arguments[ 2 ], arguments[ 3 ], arguments[ 4 ], arguments[ 5 ], arguments[ 6 ] );
}
/* jshint proto:true */
date.__proto__ = FakeDate.prototype;
return date;
}
FakeDate.prototype = FakeDate.today = new Date();
return FakeDate;
})( Date );
// Simple number parser for this test purposes.

@@ -170,2 +201,4 @@ function simpleParseNumber( value ) {

QUnit.test( "should parse day (d) with no padding", function( assert ) {
var OrigDate;
date1 = new Date();

@@ -175,2 +208,21 @@ date1.setDate( 2 );

assertParse( assert, "2", "d", cldr, date1 );
/* globals Date:true */
// Test #323 - Day parsing must use the correct day range given its corresponding month/year.
OrigDate = Date;
Date = FakeDate;
date1 = new Date( 2014, 1, 28 );
date1 = startOf( date1, "day" );
FakeDate.today = new Date( 2014, 1 );
assertParse( assert, "29", "d", cldr, null );
assertParse( assert, "28", "d", cldr, date1 );
date2 = new Date( 2016, 1, 29 );
date2 = startOf( date2, "day" );
FakeDate.today = new Date( 2016, 1 );
assertParse( assert, "30", "d", cldr, null );
assertParse( assert, "29", "d", cldr, date2 );
Date = OrigDate;
});

@@ -186,2 +238,4 @@

QUnit.test( "should parse day of year (D) with no padding", function( assert ) {
var OrigDate;
date1 = new Date();

@@ -192,2 +246,17 @@ date1.setMonth( 0 );

assertParse( assert, "2", "D", cldr, date1 );
/* globals Date:true */
// Test #323 - Day of year parsing must use the correct day range given leap year into account.
OrigDate = Date;
Date = FakeDate;
FakeDate.today = new Date( 2014, 1 );
assertParse( assert, "366", "D", cldr, null );
// date1 = last day of 2016
date1 = new Date( 2017, 0, 0 );
FakeDate.today = new Date( 2016, 1 );
assertParse( assert, "366", "D", cldr, date1 );
Date = OrigDate;
});

@@ -194,0 +263,0 @@

@@ -5,3 +5,6 @@ define([

"json!cldr-data/main/en/ca-gregorian.json",
"json!cldr-data/supplemental/likelySubtags.json"
"json!cldr-data/supplemental/likelySubtags.json",
"cldr/event",
"cldr/supplemental"
], function( Cldr, tokenizerProperties, enCaGregorian, likelySubtags ) {

@@ -8,0 +11,0 @@

@@ -9,3 +9,6 @@ define([

"json!cldr-data/supplemental/timeData.json",
"json!cldr-data/supplemental/weekData.json"
"json!cldr-data/supplemental/weekData.json",
"cldr/event",
"cldr/supplemental"
], function( Cldr, tokenizer, tokenizerProperties, enCaGregorian, enNumbers, likelySubtags,

@@ -12,0 +15,0 @@ timeData, weekData ) {

@@ -6,3 +6,6 @@ define([

"json!cldr-data/main/es/numbers.json",
"json!cldr-data/supplemental/likelySubtags.json"
"json!cldr-data/supplemental/likelySubtags.json",
"cldr/event",
"cldr/supplemental"
], function( Cldr, properties, enNumbers, esNumbers, likelySubtags ) {

@@ -9,0 +12,0 @@

@@ -10,3 +10,6 @@ define([

"json!cldr-data/supplemental/likelySubtags.json",
"json!cldr-data/supplemental/numberingSystems.json"
"json!cldr-data/supplemental/numberingSystems.json",
"cldr/event",
"cldr/supplemental"
], function( Cldr, format, properties, arNumbers, enNumbers, esNumbers, zhNumbers, likelySubtags,

@@ -13,0 +16,0 @@ numberingSystems ) {

@@ -6,3 +6,6 @@ define([

"json!cldr-data/main/es/numbers.json",
"json!cldr-data/supplemental/likelySubtags.json"
"json!cldr-data/supplemental/likelySubtags.json",
"cldr/event",
"cldr/supplemental"
], function( Cldr, properties, enNumbers, esNumbers, likelySubtags ) {

@@ -9,0 +12,0 @@

@@ -12,3 +12,6 @@ define([

"json!cldr-data/supplemental/likelySubtags.json",
"json!cldr-data/supplemental/numberingSystems.json"
"json!cldr-data/supplemental/numberingSystems.json",
"cldr/event",
"cldr/supplemental"
], function( Cldr, parse, properties, arNumbers, enNumbers, esNumbers, ruNumbers, svNumbers,

@@ -15,0 +18,0 @@ zhNumbers, likelySubtags, numberingSystems ) {

@@ -5,3 +5,6 @@ define([

"json!cldr-data/main/en/numbers.json",
"json!cldr-data/supplemental/likelySubtags.json"
"json!cldr-data/supplemental/likelySubtags.json",
"cldr/event",
"cldr/supplemental"
], function( Cldr, properties, enNumbers, likelySubtags ) {

@@ -8,0 +11,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc