Comparing version 1.1.0 to 1.1.1
/** | ||
* Globalize Runtime v1.1.0 | ||
* Globalize Runtime v1.1.1 | ||
* | ||
@@ -10,6 +10,6 @@ * http://github.com/jquery/globalize | ||
* | ||
* Date: 2016-01-20T17:24Z | ||
* Date: 2016-02-04T12:01Z | ||
*/ | ||
/*! | ||
* Globalize Runtime v1.1.0 2016-01-20T17:24Z Released under the MIT license | ||
* Globalize Runtime v1.1.1 2016-02-04T12:01Z Released under the MIT license | ||
* http://git.io/TrdQbw | ||
@@ -16,0 +16,0 @@ */ |
/** | ||
* Globalize Runtime v1.1.0 | ||
* Globalize Runtime v1.1.1 | ||
* | ||
@@ -10,6 +10,6 @@ * http://github.com/jquery/globalize | ||
* | ||
* Date: 2016-01-20T17:24Z | ||
* Date: 2016-02-04T12:01Z | ||
*/ | ||
/*! | ||
* Globalize Runtime v1.1.0 2016-01-20T17:24Z Released under the MIT license | ||
* Globalize Runtime v1.1.1 2016-02-04T12:01Z Released under the MIT license | ||
* http://git.io/TrdQbw | ||
@@ -16,0 +16,0 @@ */ |
/** | ||
* Globalize Runtime v1.1.0 | ||
* Globalize Runtime v1.1.1 | ||
* | ||
@@ -10,6 +10,6 @@ * http://github.com/jquery/globalize | ||
* | ||
* Date: 2016-01-20T17:24Z | ||
* Date: 2016-02-04T12:01Z | ||
*/ | ||
/*! | ||
* Globalize Runtime v1.1.0 2016-01-20T17:24Z Released under the MIT license | ||
* Globalize Runtime v1.1.1 2016-02-04T12:01Z Released under the MIT license | ||
* http://git.io/TrdQbw | ||
@@ -560,3 +560,3 @@ */ | ||
var dateParse = function( value, tokens, properties ) { | ||
var amPm, day, daysOfYear, era, hour, hour12, timezoneOffset, valid, | ||
var amPm, day, daysOfYear, month, era, hour, hour12, timezoneOffset, valid, | ||
YEAR = 0, | ||
@@ -645,3 +645,6 @@ MONTH = 1, | ||
} | ||
dateSetMonth( date, value - 1 ); | ||
// Setting the month later so that we have the correct year and can determine | ||
// the correct last day of February in case of leap year. | ||
month = value; | ||
truncateAt.push( MONTH ); | ||
@@ -788,2 +791,6 @@ break; | ||
if ( month !== undefined ) { | ||
dateSetMonth( date, month - 1 ); | ||
} | ||
if ( day !== undefined ) { | ||
@@ -790,0 +797,0 @@ if ( outOfRange( day, 1, dateLastDayOfMonth( date ) ) ) { |
/** | ||
* Globalize Runtime v1.1.0 | ||
* Globalize Runtime v1.1.1 | ||
* | ||
@@ -10,6 +10,6 @@ * http://github.com/jquery/globalize | ||
* | ||
* Date: 2016-01-20T17:24Z | ||
* Date: 2016-02-04T12:01Z | ||
*/ | ||
/*! | ||
* Globalize Runtime v1.1.0 2016-01-20T17:24Z Released under the MIT license | ||
* Globalize Runtime v1.1.1 2016-02-04T12:01Z Released under the MIT license | ||
* http://git.io/TrdQbw | ||
@@ -16,0 +16,0 @@ */ |
/** | ||
* Globalize Runtime v1.1.0 | ||
* Globalize Runtime v1.1.1 | ||
* | ||
@@ -10,6 +10,6 @@ * http://github.com/jquery/globalize | ||
* | ||
* Date: 2016-01-20T17:24Z | ||
* Date: 2016-02-04T12:01Z | ||
*/ | ||
/*! | ||
* Globalize Runtime v1.1.0 2016-01-20T17:24Z Released under the MIT license | ||
* Globalize Runtime v1.1.1 2016-02-04T12:01Z Released under the MIT license | ||
* http://git.io/TrdQbw | ||
@@ -16,0 +16,0 @@ */ |
/** | ||
* Globalize Runtime v1.1.0 | ||
* Globalize Runtime v1.1.1 | ||
* | ||
@@ -10,6 +10,6 @@ * http://github.com/jquery/globalize | ||
* | ||
* Date: 2016-01-20T17:24Z | ||
* Date: 2016-02-04T12:01Z | ||
*/ | ||
/*! | ||
* Globalize Runtime v1.1.0 2016-01-20T17:24Z Released under the MIT license | ||
* Globalize Runtime v1.1.1 2016-02-04T12:01Z Released under the MIT license | ||
* http://git.io/TrdQbw | ||
@@ -16,0 +16,0 @@ */ |
/** | ||
* Globalize Runtime v1.1.0 | ||
* Globalize Runtime v1.1.1 | ||
* | ||
@@ -10,6 +10,6 @@ * http://github.com/jquery/globalize | ||
* | ||
* Date: 2016-01-20T17:24Z | ||
* Date: 2016-02-04T12:01Z | ||
*/ | ||
/*! | ||
* Globalize Runtime v1.1.0 2016-01-20T17:24Z Released under the MIT license | ||
* Globalize Runtime v1.1.1 2016-02-04T12:01Z Released under the MIT license | ||
* http://git.io/TrdQbw | ||
@@ -16,0 +16,0 @@ */ |
/** | ||
* Globalize Runtime v1.1.0 | ||
* Globalize Runtime v1.1.1 | ||
* | ||
@@ -10,6 +10,6 @@ * http://github.com/jquery/globalize | ||
* | ||
* Date: 2016-01-20T17:24Z | ||
* Date: 2016-02-04T12:01Z | ||
*/ | ||
/*! | ||
* Globalize Runtime v1.1.0 2016-01-20T17:24Z Released under the MIT license | ||
* Globalize Runtime v1.1.1 2016-02-04T12:01Z Released under the MIT license | ||
* http://git.io/TrdQbw | ||
@@ -119,2 +119,3 @@ */ | ||
Globalize.prototype.unitFormatter = function( unit, options ) { | ||
options = options || {}; | ||
return Globalize[ runtimeKey( "unitFormatter", this._locale, [ unit, options ] ) ]; | ||
@@ -121,0 +122,0 @@ }; |
/** | ||
* Globalize v1.1.0 | ||
* Globalize v1.1.1 | ||
* | ||
@@ -10,6 +10,6 @@ * http://github.com/jquery/globalize | ||
* | ||
* Date: 2016-01-20T17:24Z | ||
* Date: 2016-02-04T12:01Z | ||
*/ | ||
/*! | ||
* Globalize v1.1.0 2016-01-20T17:24Z Released under the MIT license | ||
* Globalize v1.1.1 2016-02-04T12:01Z Released under the MIT license | ||
* http://git.io/TrdQbw | ||
@@ -139,9 +139,30 @@ */ | ||
var functionName = function( fn ) { | ||
if ( fn.name !== undefined ) { | ||
return fn.name; | ||
} | ||
// fn.name is not supported by IE. | ||
var matches = /^function\s+([\w\$]+)\s*\(/.exec( fn.toString() ); | ||
if ( matches && matches.length > 0 ) { | ||
return matches[ 1 ]; | ||
} | ||
}; | ||
var runtimeBind = function( args, cldr, fn, runtimeArgs ) { | ||
// 1: fn.name isn't supported by IE. | ||
var argsStr = JSON.stringify( args ), | ||
fnName = fn.name || /^function\s+([\w\$]+)\s*\(/.exec( fn.toString() )[ 1 ], /* 1 */ | ||
fnName = functionName( fn ), | ||
locale = cldr.locale; | ||
// If name of the function is not available, this is most likely due uglification, | ||
// which most likely means we are in production, and runtimeBind here is not necessary. | ||
if ( !fnName ) { | ||
return fn; | ||
} | ||
fn.runtimeKey = runtimeKey( fnName, locale, null, argsStr ); | ||
@@ -148,0 +169,0 @@ |
/*! | ||
* Globalize v1.1.0 | ||
* Globalize v1.1.1 | ||
* | ||
@@ -10,3 +10,3 @@ * http://github.com/jquery/globalize | ||
* | ||
* Date: 2016-01-20T17:24Z | ||
* Date: 2016-02-04T12:01Z | ||
*/ | ||
@@ -13,0 +13,0 @@ (function( root, factory ) { |
/** | ||
* Globalize v1.1.0 | ||
* Globalize v1.1.1 | ||
* | ||
@@ -10,6 +10,6 @@ * http://github.com/jquery/globalize | ||
* | ||
* Date: 2016-01-20T17:24Z | ||
* Date: 2016-02-04T12:01Z | ||
*/ | ||
/*! | ||
* Globalize v1.1.0 2016-01-20T17:24Z Released under the MIT license | ||
* Globalize v1.1.1 2016-02-04T12:01Z Released under the MIT license | ||
* http://git.io/TrdQbw | ||
@@ -921,3 +921,3 @@ */ | ||
var dateParse = function( value, tokens, properties ) { | ||
var amPm, day, daysOfYear, era, hour, hour12, timezoneOffset, valid, | ||
var amPm, day, daysOfYear, month, era, hour, hour12, timezoneOffset, valid, | ||
YEAR = 0, | ||
@@ -1006,3 +1006,6 @@ MONTH = 1, | ||
} | ||
dateSetMonth( date, value - 1 ); | ||
// Setting the month later so that we have the correct year and can determine | ||
// the correct last day of February in case of leap year. | ||
month = value; | ||
truncateAt.push( MONTH ); | ||
@@ -1149,2 +1152,6 @@ break; | ||
if ( month !== undefined ) { | ||
dateSetMonth( date, month - 1 ); | ||
} | ||
if ( day !== undefined ) { | ||
@@ -1151,0 +1158,0 @@ if ( outOfRange( day, 1, dateLastDayOfMonth( date ) ) ) { |
/** | ||
* Globalize v1.1.0 | ||
* Globalize v1.1.1 | ||
* | ||
@@ -10,6 +10,6 @@ * http://github.com/jquery/globalize | ||
* | ||
* Date: 2016-01-20T17:24Z | ||
* Date: 2016-02-04T12:01Z | ||
*/ | ||
/*! | ||
* Globalize v1.1.0 2016-01-20T17:24Z Released under the MIT license | ||
* Globalize v1.1.1 2016-02-04T12:01Z Released under the MIT license | ||
* http://git.io/TrdQbw | ||
@@ -16,0 +16,0 @@ */ |
/** | ||
* Globalize v1.1.0 | ||
* Globalize v1.1.1 | ||
* | ||
@@ -10,6 +10,6 @@ * http://github.com/jquery/globalize | ||
* | ||
* Date: 2016-01-20T17:24Z | ||
* Date: 2016-02-04T12:01Z | ||
*/ | ||
/*! | ||
* Globalize v1.1.0 2016-01-20T17:24Z Released under the MIT license | ||
* Globalize v1.1.1 2016-02-04T12:01Z Released under the MIT license | ||
* http://git.io/TrdQbw | ||
@@ -16,0 +16,0 @@ */ |
/** | ||
* Globalize v1.1.0 | ||
* Globalize v1.1.1 | ||
* | ||
@@ -10,6 +10,6 @@ * http://github.com/jquery/globalize | ||
* | ||
* Date: 2016-01-20T17:24Z | ||
* Date: 2016-02-04T12:01Z | ||
*/ | ||
/*! | ||
* Globalize v1.1.0 2016-01-20T17:24Z Released under the MIT license | ||
* Globalize v1.1.1 2016-02-04T12:01Z Released under the MIT license | ||
* http://git.io/TrdQbw | ||
@@ -16,0 +16,0 @@ */ |
/** | ||
* Globalize v1.1.0 | ||
* Globalize v1.1.1 | ||
* | ||
@@ -10,6 +10,6 @@ * http://github.com/jquery/globalize | ||
* | ||
* Date: 2016-01-20T17:24Z | ||
* Date: 2016-02-04T12:01Z | ||
*/ | ||
/*! | ||
* Globalize v1.1.0 2016-01-20T17:24Z Released under the MIT license | ||
* Globalize v1.1.1 2016-02-04T12:01Z Released under the MIT license | ||
* http://git.io/TrdQbw | ||
@@ -16,0 +16,0 @@ */ |
/** | ||
* Globalize v1.1.0 | ||
* Globalize v1.1.1 | ||
* | ||
@@ -10,6 +10,6 @@ * http://github.com/jquery/globalize | ||
* | ||
* Date: 2016-01-20T17:24Z | ||
* Date: 2016-02-04T12:01Z | ||
*/ | ||
/*! | ||
* Globalize v1.1.0 2016-01-20T17:24Z Released under the MIT license | ||
* Globalize v1.1.1 2016-02-04T12:01Z Released under the MIT license | ||
* http://git.io/TrdQbw | ||
@@ -16,0 +16,0 @@ */ |
/*! | ||
* Globalize v1.1.0 | ||
* Globalize v1.1.1 | ||
* | ||
@@ -10,3 +10,3 @@ * http://github.com/jquery/globalize | ||
* | ||
* Date: 2016-01-20T17:24Z | ||
* Date: 2016-02-04T12:01Z | ||
*/ | ||
@@ -13,0 +13,0 @@ |
@@ -35,2 +35,3 @@ /** | ||
"json!cldr-data/main/en/numbers.json", | ||
"json!cldr-data/main/en/units.json", | ||
"json!cldr-data/supplemental/currencyData.json", | ||
@@ -49,5 +50,6 @@ "json!cldr-data/supplemental/likelySubtags.json", | ||
"globalize/plural", | ||
"globalize/relative-time" | ||
], function( Globalize, enGregorian, enCurrencies, enDateFields, enNumbers, currencyData, likelySubtags, | ||
pluralsData, timeData, weekData, messages ) { | ||
"globalize/relative-time", | ||
"globalize/unit" | ||
], function( Globalize, enGregorian, enCurrencies, enDateFields, enNumbers, enUnits, currencyData, | ||
likelySubtags, pluralsData, timeData, weekData, messages ) { | ||
@@ -63,2 +65,3 @@ var en, like, number; | ||
enNumbers, | ||
enUnits, | ||
likelySubtags, | ||
@@ -100,2 +103,7 @@ pluralsData, | ||
// Use Globalize to format a unit. | ||
document.getElementById( "unit" ).textContent = en.formatUnit( 60, "mile/hour", { | ||
form: "short" | ||
}); | ||
document.getElementById( "requirements" ).style.display = "none"; | ||
@@ -102,0 +110,0 @@ document.getElementById( "demo" ).style.display = "block"; |
@@ -17,2 +17,5 @@ var Globalize = require( "globalize" ); | ||
var unitFormatter = Globalize.unitFormatter( "mile/hour", { form: "short" } ); | ||
document.getElementById( "unit" ).textContent = unitFormatter( 60 ); | ||
// Messages. | ||
@@ -24,2 +27,3 @@ document.getElementById( "intro-1" ).textContent = Globalize.formatMessage( "intro-1" ); | ||
document.getElementById( "relative-time-label" ).textContent = Globalize.formatMessage( "relative-time-label" ); | ||
document.getElementById( "unit-label" ).textContent = Globalize.formatMessage( "unit-label" ); | ||
document.getElementById( "message-1" ).textContent = Globalize.formatMessage( "message-1", { | ||
@@ -29,3 +33,4 @@ currency: currencyFormatter( 69900 ), | ||
number: numberFormatter( 12345.6789 ), | ||
relativeTime: relativeTimeFormatter( 0 ) | ||
relativeTime: relativeTimeFormatter( 0 ), | ||
unit: unitFormatter( 60 ) | ||
}); | ||
@@ -50,3 +55,4 @@ | ||
number: numberFormatter( 12345.6789 ), | ||
relativeTime: relativeTimeFormatter( elapsedTime ) | ||
relativeTime: relativeTimeFormatter( elapsedTime ), | ||
unit: unitFormatter( 60 ) | ||
}); | ||
@@ -53,0 +59,0 @@ |
@@ -8,3 +8,4 @@ { | ||
"relative-time-label": "الوقت النسبي", | ||
"message-1": "مثال علي رسالة باستخدام أرقام مختلطة \"{number}\", عملات \"{currency}\" , تواريخ \"{date}\" , ووقت نسبي \"{relativeTime}\".", | ||
"unit-label": "وحدة القياس", | ||
"message-1": "مثال علي رسالة باستخدام رقم مختلط \"{number}\", عملة \"{currency}\", تاريخ \"{date}\", وقت نسبي \"{relativeTime}\", و وحدة قياس \"{unit}\" .", | ||
"message-2": [ | ||
@@ -11,0 +12,0 @@ "مثال على رسالة بدعم صيغة الجمع:", |
@@ -8,3 +8,4 @@ { | ||
"relative-time-label": "Relative Zeit", | ||
"message-1": "Ein Beispieltext der eine Mischung aus Zahl \"{number}\", Währung \"{currency}\", Datum \"{date}\", und relativer Zeit \"{relativeTime}\" verwendet.", | ||
"unit-label": "Einheit", | ||
"message-1": "Ein Beispiel mit Zahl \"{number}\", Währung \"{currency}\", Datum \"{date}\", relative Zeit \"{relativeTime}\", und Einheit \"{unit}\".", | ||
"message-2": [ | ||
@@ -11,0 +12,0 @@ "Ein Beispieltext mit Unterstützung von Plural Formen: ", |
@@ -8,3 +8,4 @@ { | ||
"relative-time-label": "Relative Time", | ||
"message-1": "An example of a message using mixed numbers \"{number}\", currencies \"{currency}\", dates \"{date}\", and relative time \"{relativeTime}\".", | ||
"unit-label": "Unit", | ||
"message-1": "An example of a message using mixed number \"{number}\", currency \"{currency}\", date \"{date}\", relative time \"{relativeTime}\", and unit \"{unit}\".", | ||
"message-2": [ | ||
@@ -11,0 +12,0 @@ "An example of a message with pluralization support:", |
@@ -8,3 +8,4 @@ { | ||
"relative-time-label": "Tiempo Relativo", | ||
"message-1": "Un ejemplo de mensaje usando números mixtos \"{number}\", monedas \"{currency}\", fechas \"{date}\", y tiempo relativo \"{relativeTime}\".", | ||
"unit-label": "Unidad", | ||
"message-1": "Un ejemplo de mensaje usando números mixtos \"{number}\", monedas \"{currency}\", fechas \"{date}\", tiempo relativo \"{relativeTime}\", y unidades \"{unit}\".", | ||
"message-2": [ | ||
@@ -11,0 +12,0 @@ "Un ejemplo de mensaje con soporte de pluralización:", |
@@ -8,3 +8,4 @@ { | ||
"relative-time-label": "Tempo relativo", | ||
"message-1": "Um exemplo de mensagem com mistura de números \"{number}\", moedas \"{currency}\", datas \"{date}\", e tempo relativo \"{relativeTime}\".", | ||
"unit-label": "Unit", | ||
"message-1": "Um exemplo de mensagem com mistura de número \"{number}\", moeda \"{currency}\", data \"{date}\", tempo relativo \"{relativeTime}\", e unidade \"{unit}\".", | ||
"message-2": [ | ||
@@ -11,0 +12,0 @@ "Um exemplo de message com suporte a pluralização:", |
@@ -8,3 +8,4 @@ { | ||
"relative-time-label": "Относительное время", | ||
"message-1": "Пример сообщения со смешанными числами \"{number}\", валютой \"{currency}\", датами \"{date}\" и относительным временем \"{relativeTime}\".", | ||
"unit-label": "Единица измерения", | ||
"message-1": "Пример сообщения с числом \"{number}\", валютой \"{currency}\", датой \"{date}\", относительным временем \"{relativeTime}\" и единицей измерения \"{unit}\".", | ||
"message-2": [ | ||
@@ -11,0 +12,0 @@ "Пример сообщения с поддержкой множественного числа:", |
@@ -8,3 +8,4 @@ { | ||
"relative-time-label": "相对时间", | ||
"message-1": "使用混合数的消息的示例\"{number}\",货币\"{currency}\",日期\"{date}\",和相对时间\"{relativeTime}\"。", | ||
"unit-label": "单元", | ||
"message-1": "使用混合数\"{number}\",货币\"{currency}\",日期\"{date}\",相对时间\"{relativeTime}\"和单元\"{unit}\"的消息的例子。", | ||
"message-2": [ | ||
@@ -11,0 +12,0 @@ "与多元化支持消息的例子:", |
@@ -5,5 +5,2 @@ { | ||
"cldr-data": ">=25", | ||
"globalize": "1.1.x", | ||
"extract-text-webpack-plugin": "^0.8.2", | ||
"globalize-webpack-plugin": "0.3.x", | ||
"html-webpack-plugin": "^1.1.0", | ||
@@ -10,0 +7,0 @@ "nopt": "^3.0.3", |
@@ -17,7 +17,8 @@ var webpack = require( "webpack" ); | ||
"globalize/dist/globalize-runtime/number", | ||
"globalize/dist/globalize-runtime/plural", | ||
"globalize/dist/globalize-runtime/message", | ||
"globalize/dist/globalize-runtime/currency", | ||
"globalize/dist/globalize-runtime/date", | ||
"globalize/dist/globalize-runtime/relative-time" | ||
"globalize/dist/globalize-runtime/message", | ||
"globalize/dist/globalize-runtime/plural", | ||
"globalize/dist/globalize-runtime/relative-time", | ||
"globalize/dist/globalize-runtime/unit" | ||
] | ||
@@ -24,0 +25,0 @@ } : "./app/index.js", |
@@ -30,5 +30,10 @@ var like, number; | ||
// Use Globalize to format a relative time. | ||
document.getElementById( "relative-time" ).innerText = Globalize.formatRelativeTime( -35, "second" ); | ||
document.getElementById( "relative-time" ).textContent = Globalize.formatRelativeTime( -35, "second" ); | ||
// Use Globalize to format a unit. | ||
document.getElementById( "unit" ).textContent = Globalize.formatUnit( 60, "mile/hour", { | ||
form: "short" | ||
}); | ||
document.getElementById( "requirements" ).style.display = "none"; | ||
document.getElementById( "demo" ).style.display = "block"; |
@@ -109,2 +109,14 @@ { | ||
} | ||
}, | ||
"units": { | ||
"short": { | ||
"per": { | ||
"compoundUnitPattern": "{0}/{1}" | ||
}, | ||
"speed-mile-per-hour": { | ||
"displayName": "miles/hour", | ||
"unitPattern-count-one": "{0} mph", | ||
"unitPattern-count-other": "{0} mph" | ||
} | ||
} | ||
} | ||
@@ -111,0 +123,0 @@ } |
@@ -10,2 +10,3 @@ var like; | ||
require( "cldr-data/main/en/numbers" ), | ||
require( "cldr-data/main/en/units" ), | ||
require( "cldr-data/supplemental/currencyData" ), | ||
@@ -43,1 +44,4 @@ require( "cldr-data/supplemental/likelySubtags" ), | ||
console.log( Globalize.formatRelativeTime( -35, "second" ) ); | ||
// Use Globalize to format unit. | ||
console.log( Globalize.formatUnit( 60, "mile/hour", { form: "short" } ) ); |
{ | ||
"name": "globalize", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "A JavaScript library for internationalization and localization that leverages the official Unicode CLDR JSON data.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
389292
8576