Skip to content

Commit bba5617

Browse files
committed
Revert "Rename timeZoneData property to simpler timeZone"
My mistake. This new name can cause confusion with time zone ID (instead of data). This reverts commit c6b9b8c.
1 parent 862ded0 commit bba5617

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ globalize.formatNumber( ... );
141141

142142
    **cldr** optional. It's an *Object* with CLDR data (in the JSON format) or a *Function* taking one argument: locale, a *String*; returning an *Object* with the CLDR data for the passed locale. Defaults to the entire supplemental data plus the entire main data for the defaultLocale.
143143

144-
    **timeZone** optional. It's an *Object* with IANA time zone data (in the JSON format) or a *Function* returning an *Object* with the IANA time zone data. Defaults to the entire IANA time zone data from [iana-tz-data](https://github.com/rxaviers/iana-tz-data) package.
144+
    **timeZoneData** optional. It's an *Object* with IANA time zone data (in the JSON format) or a *Function* returning an *Object* with the IANA time zone data. Defaults to the entire IANA time zone data from `[iana-tz-data](https://github.com/rxaviers/iana-tz-data)` package.
145145

146146
    **messages** optional. It's an *Object* with messages data (in the JSON format) or a *Function* taking one argument: locale, a *String*; returning an *Object* with the messages data for the passed locale. Defaults to `{}`.
147147

lib/compile-extracts.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function alwaysArray( itemOrArray ) {
55
}
66

77
function compileExtracts( attributes ) {
8-
var cldr, cldrObject, defaultLocale, extracts, formattersAndParsers, timeZone, timeZoneObject, messages, messagesObject;
8+
var cldr, cldrObject, defaultLocale, extracts, formattersAndParsers, timeZoneData, timeZoneDataObject, messages, messagesObject;
99
var Globalize = require( "globalize" );
1010

1111
attributes = attributes || {};
@@ -48,13 +48,13 @@ function compileExtracts( attributes ) {
4848
};
4949
}
5050

51-
timeZone = attributes.timeZone || function() {
51+
timeZoneData = attributes.timeZoneData || function() {
5252
return require( "iana-tz-data" );
5353
};
54-
if ( typeof timeZone === "object" ) {
55-
timeZoneObject = timeZone;
56-
timeZone = function() {
57-
return timeZoneObject;
54+
if ( typeof timeZoneData === "object" ) {
55+
timeZoneDataObject = timeZoneData;
56+
timeZoneData = function() {
57+
return timeZoneDataObject;
5858
};
5959
}
6060

@@ -64,7 +64,7 @@ function compileExtracts( attributes ) {
6464

6565
Globalize.load( cldr( defaultLocale ) );
6666
Globalize.loadMessages( messages( defaultLocale ) );
67-
Globalize.loadTimeZone( timeZone() );
67+
Globalize.loadTimeZone( timeZoneData() );
6868
Globalize.locale( defaultLocale );
6969
formattersAndParsers = alwaysArray( extracts ).reduce(function( sum, extract ) {
7070
[].push.apply( sum, extract( Globalize ) );

0 commit comments

Comments
 (0)