This commit is contained in:
你的名字
2025-07-14 10:22:40 +08:00
commit 0483b4b364
1388 changed files with 219353 additions and 0 deletions

20
nodejs/node_modules/moment-timezone/LICENSE generated vendored Executable file
View File

@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) JS Foundation and other contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

36
nodejs/node_modules/moment-timezone/README.md generated vendored Executable file
View File

@ -0,0 +1,36 @@
# [Moment Timezone](http://momentjs.com/timezone)
[![Join the chat at https://gitter.im/moment/moment-timezone](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/moment/moment-timezone?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![NPM version][npm-version-image]][npm-url] [![NPM downloads][npm-downloads-image]][npm-url] [![MIT License][license-image]][license-url] [![Build Status][travis-image]][travis-url]
IANA Time Zone Database + [Moment.js](http://momentjs.com).
```js
var june = moment("2014-06-01T12:00:00Z");
june.tz('America/Los_Angeles').format('ha z'); // 5am PDT
june.tz('America/New_York').format('ha z'); // 8am EDT
june.tz('Asia/Tokyo').format('ha z'); // 9pm JST
june.tz('Australia/Sydney').format('ha z'); // 10pm EST
var dec = moment("2014-12-01T12:00:00Z");
dec.tz('America/Los_Angeles').format('ha z'); // 4am PST
dec.tz('America/New_York').format('ha z'); // 7am EST
dec.tz('Asia/Tokyo').format('ha z'); // 9pm JST
dec.tz('Australia/Sydney').format('ha z'); // 11pm EST
```
#### [Contribute code or compile time zone data](contributing.md)
#### [Read the changelog](changelog.md)
[license-image]: http://img.shields.io/badge/license-MIT-blue.svg?style=flat
[license-url]: LICENSE
[npm-url]: https://npmjs.org/package/moment-timezone
[npm-version-image]: http://img.shields.io/npm/v/moment-timezone.svg?style=flat
[npm-downloads-image]: http://img.shields.io/npm/dm/moment-timezone.svg?style=flat
[travis-url]: http://travis-ci.org/moment/moment-timezone
[travis-image]: http://img.shields.io/travis/moment/moment-timezone/develop.svg?style=flat

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

178
nodejs/node_modules/moment-timezone/changelog.md generated vendored Executable file
View File

@ -0,0 +1,178 @@
### `0.5.23` _2018-10-28_
* Fix minor issue with tz guessing in Russia [#691](https://github.com/moment/moment-timezone/pull/691)
### `0.5.22` _2018-10-28_
* Updated data to IANA TZDB `2018g` [#689](https://github.com/moment/moment-timezone/pull/689)
* Fix issue with missing LMT entries for some zones, and fix data builds on Linux and Windows [#308](https://github.com/moment/moment-timezone/issues/308)
### `0.5.21` _2018-06-23_
* Bugfix: revert breaking change introduced in 0.5.18
### `0.5.20` _2018-06-18_
* Bugfix: accidentally commented code
### `0.5.19` _2018-06-18_
* Revert: moved moment to peerDependencies
### `0.5.18` _2018-06-18_
* Return error when timezone name is not a string.
* Moved moment to peerDependencies [#628](https://github.com/moment/moment-timezone/pull/628)
* Prefer nodejs to amd declaration [#573](https://github.com/moment/moment-timezone/pull/573)
### `0.5.17` _2018-05-12_
* Updated data to IANA TZDB `2018d`. [#616](https://github.com/moment/moment-timezone/pull/616)
### `0.5.16` _2018-04-18_
* Fixed Etc/UTC timezone recognition, updated tests. [#599](https://github.com/moment/moment-timezone/pull/599)
* Updated minified files to contain IANA TZDB `2018d` data
### `0.5.15` _2018-04-17_
* Updated data to IANA TZDB `2018d`. [#596](https://github.com/moment/moment-timezone/pull/596)
### `0.5.14` _2017-10-30_
* Ensure Intl response is valid when guessing time zone. [#553](https://github.com/moment/moment-timezone/pull/553)
* Updated data to IANA TZDB `2017c`. [#552](https://github.com/moment/moment-timezone/pull/552)
* Convert to tz keeping wall time [#505](https://github.com/moment/moment-timezone/pull/505)
* Make all time zones available for guessing. [#483](https://github.com/moment/moment-timezone/pull/483)
* zone.offset has been deprecated in favor of zone.utcOffset [#398](https://github.com/moment/moment-timezone/pull/398)
* Check for timestamp formats when parsing [#348](https://github.com/moment/moment-timezone/pull/348)
### `0.5.13` _2017-04-04_
* Bumped version to address Bower cache issues with last release. [#474](https://github.com/moment/moment-timezone/issues/474)
* (No actual changes otherwise)
### `0.5.12` _2017-04-02_
* Updated data to IANA TZDB `2017b`. [#422](https://github.com/moment/moment-timezone/pull/460)
* Build the truncated data file as 2012-2022 (+/- 5 years).
### `0.5.11` _2016-12-23_
* Remove log statement when data is loaded twice. [#352](https://github.com/moment/moment-timezone/pull/352)
### `0.5.10` _2016-11-27_
* Updated data to IANA TZDB `2016j`. [#422](https://github.com/moment/moment-timezone/pull/422)
### `0.5.9` _2016-11-03_
* Fixed the output of `moment.tz.version`. [#413](https://github.com/moment/moment-timezone/issues/413)
### `0.5.8` _2016-11-03_
* Updated data to IANA TZDB `2016i`. [#411](https://github.com/moment/moment-timezone/pull/411)
### `0.5.7` _2016-10-21_
* Updated data to IANA TZDB `2016h`. [#403](https://github.com/moment/moment-timezone/pull/403)
### `0.5.6` _2016-10-08_
* Updated data to IANA TZDB `2016g`. [#394](https://github.com/moment/moment-timezone/pull/394)
### `0.5.5` _2016-07-24_
* Updated data to IANA TZDB `2016f`. [#360](https://github.com/moment/moment-timezone/pull/360)
### `0.5.4` _2016-05-03_
* Updated data to IANA TZDB `2016d`. [#336](https://github.com/moment/moment-timezone/pull/336)
* Ignore the results from `Intl.DateTimeFormat().resolvedOptions().timeZone` if it is undefined. [#322](https://github.com/moment/moment-timezone/pull/322)
### `0.5.3` _2016-03-24_
* Updated data to IANA TZDB `2016c`. [#321](https://github.com/moment/moment-timezone/pull/321)
### `0.5.2` _2016-03-15_
* Updated data to IANA TZDB `2016b`. [#315](https://github.com/moment/moment-timezone/pull/315)
### `0.5.1` _2016-03-01_
* Updated data to IANA TZDB `2016a`. [#299](https://github.com/moment/moment-timezone/pull/299)
* Fixed bug when `Date#toTimeString` did not return a known format. [#302](https://github.com/moment/moment-timezone/pull/302) [#303](https://github.com/moment/moment-timezone/pull/303)
* Added lookup on `Intl.DateTimeFormat().resolvedOptions().timeZone` to `moment.tz.guess()`. [#304](https://github.com/moment/moment-timezone/pull/304) [#291](https://github.com/moment/moment-timezone/pull/291)
### `0.5.0` _2015-12-28_
* Added support for guessing the user's timezone via `moment.tz.guess()`. [#285](https://github.com/moment/moment-timezone/pull/285)
* Fixed UMD export issue when there was an html element with `id=exports`. [#275](https://github.com/moment/moment-timezone/pull/275)
* Removed jspm specific dependencies from `package.json`. [#284](https://github.com/moment/moment-timezone/pull/284)
### `0.4.1` _2015-10-07_
* Updated data to IANA TZDB `2015e`. [#253](https://github.com/moment/moment-timezone/pull/253)
* Updated data to IANA TZDB `2015f`. [#253](https://github.com/moment/moment-timezone/pull/253)
* Updated data to IANA TZDB `2015g`. [#255](https://github.com/moment/moment-timezone/pull/255)
* Added jspm dependencies for moment. [#234](https://github.com/moment/moment-timezone/pull/234)
* Included builds directory in npm. [#237](https://github.com/moment/moment-timezone/pull/237)
* Removed version field from bower.json. [#230](https://github.com/moment/moment-timezone/pull/230)
### `0.4.0` _2015-05-30_
* Updated data to IANA TZDB `2015b`. [#201](https://github.com/moment/moment-timezone/pull/201)
* Updated data to IANA TZDB `2015c`. [#214](https://github.com/moment/moment-timezone/pull/214)
* Updated data to IANA TZDB `2015d`. [#214](https://github.com/moment/moment-timezone/pull/214)
* Updated zone getter to allow lazy unpacking to improve initial page load times. [#216](https://github.com/moment/moment-timezone/pull/216)
* Added a `package.json` `jspm:main` entry point. [#194](https://github.com/moment/moment-timezone/pull/194)
* Added `composer.json`. [#222](https://github.com/moment/moment-timezone/pull/222)
* Added an error message when trying to load moment-timezone twice. [#212](https://github.com/moment/moment-timezone/pull/212)
### `0.3.1` _2015-03-16_
* Updated data to IANA TZDB `2015a`. [#183](https://github.com/moment/moment-timezone/pull/183)
### `0.3.0` _2015-01-13_
* *Breaking:* Added country data to the `meta/*.json` files. Restructured the data to support multiple countries per zone. [#162](https://github.com/moment/moment-timezone/pull/162)
* Added the ability to set a default timezone for all new moments. [#152](https://github.com/moment/moment-timezone/pull/152)
* Fixed a bug when passing a moment with an offset to `moment.tz`. [#169](https://github.com/moment/moment-timezone/pull/169)
* Fixed a deprecation in moment core, changing `moment#zone` to `moment#utcOffset`. [#168](https://github.com/moment/moment-timezone/pull/168)
### `0.2.5` _2014-11-12_
* Updated data to IANA TZDB `2014j`. [#151](https://github.com/moment/moment-timezone/pull/151)
### `0.2.4` _2014-10-20_
* Updated data to IANA TZDB `2014i`. [#142](https://github.com/moment/moment-timezone/pull/142)
### `0.2.3` _2014-10-20_
* Updated data to IANA TZDB `2014h`. [#141](https://github.com/moment/moment-timezone/pull/141)
### `0.2.2` _2014-09-04_
* Updated data to IANA TZDB `2014g`. [#126](https://github.com/moment/moment-timezone/pull/126)
* Added a warning when using `moment-timezone` with `moment<2.6.0`.
### `0.2.1` _2014-08-02_
* Fixed support for `moment@2.8.1+`.
### `0.2.0` _2014-07-21_
* Added the ability to configure whether ambiguous or invalid input is rolled forward or backward. [#101](https://github.com/moment/moment-timezone/pull/101)
* Added `moment>=2.6.0` as a dependency in `bower.json`. [#107](https://github.com/moment/moment-timezone/issues/107)
* Fixed getting the name of a zone that was added as a linked zone. [#104](https://github.com/moment/moment-timezone/pull/104)
* Added an error message when a zone was not loaded. [#106](https://github.com/moment/moment-timezone/issues/106)
### `0.1.0` _2014-06-23_
* *Breaking:* Changed data format from Zones+Rules to just Zones. [#82](https://github.com/moment/moment-timezone/pull/82)
* *Breaking:* Removed `moment.tz.{addRule,addZone,zoneExists,zones}` as they are no longer relevant with the new data format.
* Made library 20x faster. [JSPerf results](http://jsperf.com/moment-timezone-0-1-0/2)
* Completely rewrote internals to support new data format.
* Updated the data collection process to get data directly from http://www.iana.org/time-zones.
* Updated data to IANA TZDB `2014e`.
* Updated `bower.json` to use a browser specific `main:` entry point.
* Added built files with included data.
* Added support for accurately parsing input around DST changes. [#93](https://github.com/moment/moment-timezone/pull/93)
* Added comprehensive documentation at [momentjs.com/timezone/docs/](http://momentjs.com/timezone/docs/).
* Added `moment.tz.link` for linking two identical zones.
* Added `moment.tz.zone` for getting a loaded zone.
* Added `moment.tz.load` for loading a bundled version of data from the IANA TZDB.
* Added `moment.tz.names` for getting the names of all the loaded timezones.
* Added `moment.tz.unpack` and `moment.tz.unpackBase60` for unpacking data.
* Added `moment-timezone-utils.js` for working with the packed and unpacked data.
* Fixed major memory leak. [#79](https://github.com/moment/moment-timezone/issues/79)
* Fixed global export to allow use in web workers. [#78](https://github.com/moment/moment-timezone/pull/78)
* Fixed global export in browser environments that define `window.module`. [#76](https://github.com/moment/moment-timezone/pull/76)
### `0.0.6` _2014-04-20_
* Fixed issue with preventing loading moment-timezone more than once. [#75](https://github.com/moment/moment-timezone/pull/75)
### `0.0.5` _2014-04-17_
* Improved performance with memoization. [#39](https://github.com/moment/moment-timezone/issues/39)
* Published only necessary files to npm. [#46](https://github.com/moment/moment-timezone/issues/46)
* Added better handling of timezones around DST. [#53](https://github.com/moment/moment-timezone/issues/53) [#61](https://github.com/moment/moment-timezone/issues/61) [#70](https://github.com/moment/moment-timezone/issues/70)
* Added Browserify support. [#41](https://github.com/moment/moment-timezone/issues/41)
* Added `moment.tz.zoneExists` [#73](https://github.com/moment/moment-timezone/issues/73)
* Fixed cloning moments with a timezone. [#71](https://github.com/moment/moment-timezone/issues/71)
* Prevent loading moment-timezone more than once. [#74](https://github.com/moment/moment-timezone/issues/74)
### `0.0.3` _2013-10-10_
* Added Bower support.
* Added support for newer versions of moment.
* Added support for constructing a moment with a string and zone.
* Added more links and timezone names in moment-timezone.json
### `0.0.1` _2013-07-17_
* Initial version.

43
nodejs/node_modules/moment-timezone/composer.json generated vendored Executable file
View File

@ -0,0 +1,43 @@
{
"name": "moment/moment-timezone",
"description": "Parse and display dates in any timezone",
"version": "0.5.23",
"keywords": [
"moment",
"date",
"time",
"timezone",
"olson",
"iana",
"zone",
"tz"
],
"homepage": "http://momentjs.com/timezone/",
"license": "MIT",
"support": {
"issues": "https://github.com/moment/moment-timezone/issues",
"source": "https://github.com/moment/moment-timezone"
},
"authors": [
{
"name": "Tim Wood",
"email": "washwithcare@gmail.com",
"homepage": "http://timwoodcreates.com/"
}
],
"type": "component",
"require": {
"robloach/component-installer": "*",
"moment/moment": ">=2.9.0"
},
"extra": {
"component": {
"scripts": [
"moment-timezone.js"
],
"files": [
"builds/*.js"
]
}
}
}

5118
nodejs/node_modules/moment-timezone/data/meta/latest.json generated vendored Executable file

File diff suppressed because it is too large Load Diff

599
nodejs/node_modules/moment-timezone/data/packed/latest.json generated vendored Executable file

File diff suppressed because one or more lines are too long

2
nodejs/node_modules/moment-timezone/index.js generated vendored Executable file
View File

@ -0,0 +1,2 @@
var moment = module.exports = require("./moment-timezone");
moment.tz.load(require('./data/packed/latest.json'));

318
nodejs/node_modules/moment-timezone/moment-timezone-utils.js generated vendored Executable file
View File

@ -0,0 +1,318 @@
//! moment-timezone-utils.js
//! version : 0.5.23
//! Copyright (c) JS Foundation and other contributors
//! license : MIT
//! github.com/moment/moment-timezone
(function (root, factory) {
"use strict";
/*global define*/
if (typeof module === 'object' && module.exports) {
module.exports = factory(require('./')); // Node
} else if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else {
factory(root.moment); // Browser
}
}(this, function (moment) {
"use strict";
if (!moment.tz) {
throw new Error("moment-timezone-utils.js must be loaded after moment-timezone.js");
}
/************************************
Pack Base 60
************************************/
var BASE60 = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX',
EPSILON = 0.000001; // Used to fix floating point rounding errors
function packBase60Fraction(fraction, precision) {
var buffer = '.',
output = '',
current;
while (precision > 0) {
precision -= 1;
fraction *= 60;
current = Math.floor(fraction + EPSILON);
buffer += BASE60[current];
fraction -= current;
// Only add buffer to output once we have a non-zero value.
// This makes '.000' output '', and '.100' output '.1'
if (current) {
output += buffer;
buffer = '';
}
}
return output;
}
function packBase60(number, precision) {
var output = '',
absolute = Math.abs(number),
whole = Math.floor(absolute),
fraction = packBase60Fraction(absolute - whole, Math.min(~~precision, 10));
while (whole > 0) {
output = BASE60[whole % 60] + output;
whole = Math.floor(whole / 60);
}
if (number < 0) {
output = '-' + output;
}
if (output && fraction) {
return output + fraction;
}
if (!fraction && output === '-') {
return '0';
}
return output || fraction || '0';
}
/************************************
Pack
************************************/
function packUntils(untils) {
var out = [],
last = 0,
i;
for (i = 0; i < untils.length - 1; i++) {
out[i] = packBase60(Math.round((untils[i] - last) / 1000) / 60, 1);
last = untils[i];
}
return out.join(' ');
}
function packAbbrsAndOffsets(source) {
var index = 0,
abbrs = [],
offsets = [],
indices = [],
map = {},
i, key;
for (i = 0; i < source.abbrs.length; i++) {
key = source.abbrs[i] + '|' + source.offsets[i];
if (map[key] === undefined) {
map[key] = index;
abbrs[index] = source.abbrs[i];
offsets[index] = packBase60(Math.round(source.offsets[i] * 60) / 60, 1);
index++;
}
indices[i] = packBase60(map[key], 0);
}
return abbrs.join(' ') + '|' + offsets.join(' ') + '|' + indices.join('');
}
function packPopulation (number) {
if (!number) {
return '';
}
if (number < 1000) {
return '|' + number;
}
var exponent = String(number | 0).length - 2;
var precision = Math.round(number / Math.pow(10, exponent));
return '|' + precision + 'e' + exponent;
}
function validatePackData (source) {
if (!source.name) { throw new Error("Missing name"); }
if (!source.abbrs) { throw new Error("Missing abbrs"); }
if (!source.untils) { throw new Error("Missing untils"); }
if (!source.offsets) { throw new Error("Missing offsets"); }
if (
source.offsets.length !== source.untils.length ||
source.offsets.length !== source.abbrs.length
) {
throw new Error("Mismatched array lengths");
}
}
function pack (source) {
validatePackData(source);
return [
source.name,
packAbbrsAndOffsets(source),
packUntils(source.untils) + packPopulation(source.population)
].join('|');
}
/************************************
Create Links
************************************/
function arraysAreEqual(a, b) {
var i;
if (a.length !== b.length) { return false; }
for (i = 0; i < a.length; i++) {
if (a[i] !== b[i]) {
return false;
}
}
return true;
}
function zonesAreEqual(a, b) {
return arraysAreEqual(a.offsets, b.offsets) && arraysAreEqual(a.abbrs, b.abbrs) && arraysAreEqual(a.untils, b.untils);
}
function findAndCreateLinks (input, output, links, groupLeaders) {
var i, j, a, b, group, foundGroup, groups = [];
for (i = 0; i < input.length; i++) {
foundGroup = false;
a = input[i];
for (j = 0; j < groups.length; j++) {
group = groups[j];
b = group[0];
if (zonesAreEqual(a, b)) {
if (a.population > b.population) {
group.unshift(a);
} else if (a.population === b.population && groupLeaders && groupLeaders[a.name]) {
group.unshift(a);
} else {
group.push(a);
}
foundGroup = true;
}
}
if (!foundGroup) {
groups.push([a]);
}
}
for (i = 0; i < groups.length; i++) {
group = groups[i];
output.push(group[0]);
for (j = 1; j < group.length; j++) {
links.push(group[0].name + '|' + group[j].name);
}
}
}
function createLinks (source, groupLeaders) {
var zones = [],
links = [];
if (source.links) {
links = source.links.slice();
}
findAndCreateLinks(source.zones, zones, links, groupLeaders);
return {
version : source.version,
zones : zones,
links : links.sort()
};
}
/************************************
Filter Years
************************************/
function findStartAndEndIndex (untils, start, end) {
var startI = 0,
endI = untils.length + 1,
untilYear,
i;
if (!end) {
end = start;
}
if (start > end) {
i = start;
start = end;
end = i;
}
for (i = 0; i < untils.length; i++) {
if (untils[i] == null) {
continue;
}
untilYear = new Date(untils[i]).getUTCFullYear();
if (untilYear < start) {
startI = i + 1;
}
if (untilYear > end) {
endI = Math.min(endI, i + 1);
}
}
return [startI, endI];
}
function filterYears (source, start, end) {
var slice = Array.prototype.slice,
indices = findStartAndEndIndex(source.untils, start, end),
untils = slice.apply(source.untils, indices);
untils[untils.length - 1] = null;
return {
name : source.name,
abbrs : slice.apply(source.abbrs, indices),
untils : untils,
offsets : slice.apply(source.offsets, indices),
population : source.population
};
}
/************************************
Filter, Link, and Pack
************************************/
function filterLinkPack (input, start, end, groupLeaders) {
var i,
inputZones = input.zones,
outputZones = [],
output;
for (i = 0; i < inputZones.length; i++) {
outputZones[i] = filterYears(inputZones[i], start, end);
}
output = createLinks({
zones : outputZones,
links : input.links.slice(),
version : input.version
}, groupLeaders);
for (i = 0; i < output.zones.length; i++) {
output.zones[i] = pack(output.zones[i]);
}
return output;
}
/************************************
Exports
************************************/
moment.tz.pack = pack;
moment.tz.packBase60 = packBase60;
moment.tz.createLinks = createLinks;
moment.tz.filterYears = filterYears;
moment.tz.filterLinkPack = filterLinkPack;
return moment;
}));

613
nodejs/node_modules/moment-timezone/moment-timezone.js generated vendored Executable file
View File

@ -0,0 +1,613 @@
//! moment-timezone.js
//! version : 0.5.23
//! Copyright (c) JS Foundation and other contributors
//! license : MIT
//! github.com/moment/moment-timezone
(function (root, factory) {
"use strict";
/*global define*/
if (typeof module === 'object' && module.exports) {
module.exports = factory(require('moment')); // Node
} else if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else {
factory(root.moment); // Browser
}
}(this, function (moment) {
"use strict";
// Do not load moment-timezone a second time.
// if (moment.tz !== undefined) {
// logError('Moment Timezone ' + moment.tz.version + ' was already loaded ' + (moment.tz.dataVersion ? 'with data from ' : 'without any data') + moment.tz.dataVersion);
// return moment;
// }
var VERSION = "0.5.23",
zones = {},
links = {},
names = {},
guesses = {},
cachedGuess;
if (!moment || typeof moment.version !== 'string') {
logError('Moment Timezone requires Moment.js. See https://momentjs.com/timezone/docs/#/use-it/browser/');
}
var momentVersion = moment.version.split('.'),
major = +momentVersion[0],
minor = +momentVersion[1];
// Moment.js version check
if (major < 2 || (major === 2 && minor < 6)) {
logError('Moment Timezone requires Moment.js >= 2.6.0. You are using Moment.js ' + moment.version + '. See momentjs.com');
}
/************************************
Unpacking
************************************/
function charCodeToInt(charCode) {
if (charCode > 96) {
return charCode - 87;
} else if (charCode > 64) {
return charCode - 29;
}
return charCode - 48;
}
function unpackBase60(string) {
var i = 0,
parts = string.split('.'),
whole = parts[0],
fractional = parts[1] || '',
multiplier = 1,
num,
out = 0,
sign = 1;
// handle negative numbers
if (string.charCodeAt(0) === 45) {
i = 1;
sign = -1;
}
// handle digits before the decimal
for (i; i < whole.length; i++) {
num = charCodeToInt(whole.charCodeAt(i));
out = 60 * out + num;
}
// handle digits after the decimal
for (i = 0; i < fractional.length; i++) {
multiplier = multiplier / 60;
num = charCodeToInt(fractional.charCodeAt(i));
out += num * multiplier;
}
return out * sign;
}
function arrayToInt (array) {
for (var i = 0; i < array.length; i++) {
array[i] = unpackBase60(array[i]);
}
}
function intToUntil (array, length) {
for (var i = 0; i < length; i++) {
array[i] = Math.round((array[i - 1] || 0) + (array[i] * 60000)); // minutes to milliseconds
}
array[length - 1] = Infinity;
}
function mapIndices (source, indices) {
var out = [], i;
for (i = 0; i < indices.length; i++) {
out[i] = source[indices[i]];
}
return out;
}
function unpack (string) {
var data = string.split('|'),
offsets = data[2].split(' '),
indices = data[3].split(''),
untils = data[4].split(' ');
arrayToInt(offsets);
arrayToInt(indices);
arrayToInt(untils);
intToUntil(untils, indices.length);
return {
name : data[0],
abbrs : mapIndices(data[1].split(' '), indices),
offsets : mapIndices(offsets, indices),
untils : untils,
population : data[5] | 0
};
}
/************************************
Zone object
************************************/
function Zone (packedString) {
if (packedString) {
this._set(unpack(packedString));
}
}
Zone.prototype = {
_set : function (unpacked) {
this.name = unpacked.name;
this.abbrs = unpacked.abbrs;
this.untils = unpacked.untils;
this.offsets = unpacked.offsets;
this.population = unpacked.population;
},
_index : function (timestamp) {
var target = +timestamp,
untils = this.untils,
i;
for (i = 0; i < untils.length; i++) {
if (target < untils[i]) {
return i;
}
}
},
parse : function (timestamp) {
var target = +timestamp,
offsets = this.offsets,
untils = this.untils,
max = untils.length - 1,
offset, offsetNext, offsetPrev, i;
for (i = 0; i < max; i++) {
offset = offsets[i];
offsetNext = offsets[i + 1];
offsetPrev = offsets[i ? i - 1 : i];
if (offset < offsetNext && tz.moveAmbiguousForward) {
offset = offsetNext;
} else if (offset > offsetPrev && tz.moveInvalidForward) {
offset = offsetPrev;
}
if (target < untils[i] - (offset * 60000)) {
return offsets[i];
}
}
return offsets[max];
},
abbr : function (mom) {
return this.abbrs[this._index(mom)];
},
offset : function (mom) {
logError("zone.offset has been deprecated in favor of zone.utcOffset");
return this.offsets[this._index(mom)];
},
utcOffset : function (mom) {
return this.offsets[this._index(mom)];
}
};
/************************************
Current Timezone
************************************/
function OffsetAt(at) {
var timeString = at.toTimeString();
var abbr = timeString.match(/\([a-z ]+\)/i);
if (abbr && abbr[0]) {
// 17:56:31 GMT-0600 (CST)
// 17:56:31 GMT-0600 (Central Standard Time)
abbr = abbr[0].match(/[A-Z]/g);
abbr = abbr ? abbr.join('') : undefined;
} else {
// 17:56:31 CST
// 17:56:31 GMT+0800 (台北標準時間)
abbr = timeString.match(/[A-Z]{3,5}/g);
abbr = abbr ? abbr[0] : undefined;
}
if (abbr === 'GMT') {
abbr = undefined;
}
this.at = +at;
this.abbr = abbr;
this.offset = at.getTimezoneOffset();
}
function ZoneScore(zone) {
this.zone = zone;
this.offsetScore = 0;
this.abbrScore = 0;
}
ZoneScore.prototype.scoreOffsetAt = function (offsetAt) {
this.offsetScore += Math.abs(this.zone.utcOffset(offsetAt.at) - offsetAt.offset);
if (this.zone.abbr(offsetAt.at).replace(/[^A-Z]/g, '') !== offsetAt.abbr) {
this.abbrScore++;
}
};
function findChange(low, high) {
var mid, diff;
while ((diff = ((high.at - low.at) / 12e4 | 0) * 6e4)) {
mid = new OffsetAt(new Date(low.at + diff));
if (mid.offset === low.offset) {
low = mid;
} else {
high = mid;
}
}
return low;
}
function userOffsets() {
var startYear = new Date().getFullYear() - 2,
last = new OffsetAt(new Date(startYear, 0, 1)),
offsets = [last],
change, next, i;
for (i = 1; i < 48; i++) {
next = new OffsetAt(new Date(startYear, i, 1));
if (next.offset !== last.offset) {
change = findChange(last, next);
offsets.push(change);
offsets.push(new OffsetAt(new Date(change.at + 6e4)));
}
last = next;
}
for (i = 0; i < 4; i++) {
offsets.push(new OffsetAt(new Date(startYear + i, 0, 1)));
offsets.push(new OffsetAt(new Date(startYear + i, 6, 1)));
}
return offsets;
}
function sortZoneScores (a, b) {
if (a.offsetScore !== b.offsetScore) {
return a.offsetScore - b.offsetScore;
}
if (a.abbrScore !== b.abbrScore) {
return a.abbrScore - b.abbrScore;
}
return b.zone.population - a.zone.population;
}
function addToGuesses (name, offsets) {
var i, offset;
arrayToInt(offsets);
for (i = 0; i < offsets.length; i++) {
offset = offsets[i];
guesses[offset] = guesses[offset] || {};
guesses[offset][name] = true;
}
}
function guessesForUserOffsets (offsets) {
var offsetsLength = offsets.length,
filteredGuesses = {},
out = [],
i, j, guessesOffset;
for (i = 0; i < offsetsLength; i++) {
guessesOffset = guesses[offsets[i].offset] || {};
for (j in guessesOffset) {
if (guessesOffset.hasOwnProperty(j)) {
filteredGuesses[j] = true;
}
}
}
for (i in filteredGuesses) {
if (filteredGuesses.hasOwnProperty(i)) {
out.push(names[i]);
}
}
return out;
}
function rebuildGuess () {
// use Intl API when available and returning valid time zone
try {
var intlName = Intl.DateTimeFormat().resolvedOptions().timeZone;
if (intlName && intlName.length > 3) {
var name = names[normalizeName(intlName)];
if (name) {
return name;
}
logError("Moment Timezone found " + intlName + " from the Intl api, but did not have that data loaded.");
}
} catch (e) {
// Intl unavailable, fall back to manual guessing.
}
var offsets = userOffsets(),
offsetsLength = offsets.length,
guesses = guessesForUserOffsets(offsets),
zoneScores = [],
zoneScore, i, j;
for (i = 0; i < guesses.length; i++) {
zoneScore = new ZoneScore(getZone(guesses[i]), offsetsLength);
for (j = 0; j < offsetsLength; j++) {
zoneScore.scoreOffsetAt(offsets[j]);
}
zoneScores.push(zoneScore);
}
zoneScores.sort(sortZoneScores);
return zoneScores.length > 0 ? zoneScores[0].zone.name : undefined;
}
function guess (ignoreCache) {
if (!cachedGuess || ignoreCache) {
cachedGuess = rebuildGuess();
}
return cachedGuess;
}
/************************************
Global Methods
************************************/
function normalizeName (name) {
return (name || '').toLowerCase().replace(/\//g, '_');
}
function addZone (packed) {
var i, name, split, normalized;
if (typeof packed === "string") {
packed = [packed];
}
for (i = 0; i < packed.length; i++) {
split = packed[i].split('|');
name = split[0];
normalized = normalizeName(name);
zones[normalized] = packed[i];
names[normalized] = name;
addToGuesses(normalized, split[2].split(' '));
}
}
function getZone (name, caller) {
name = normalizeName(name);
var zone = zones[name];
var link;
if (zone instanceof Zone) {
return zone;
}
if (typeof zone === 'string') {
zone = new Zone(zone);
zones[name] = zone;
return zone;
}
// Pass getZone to prevent recursion more than 1 level deep
if (links[name] && caller !== getZone && (link = getZone(links[name], getZone))) {
zone = zones[name] = new Zone();
zone._set(link);
zone.name = names[name];
return zone;
}
return null;
}
function getNames () {
var i, out = [];
for (i in names) {
if (names.hasOwnProperty(i) && (zones[i] || zones[links[i]]) && names[i]) {
out.push(names[i]);
}
}
return out.sort();
}
function addLink (aliases) {
var i, alias, normal0, normal1;
if (typeof aliases === "string") {
aliases = [aliases];
}
for (i = 0; i < aliases.length; i++) {
alias = aliases[i].split('|');
normal0 = normalizeName(alias[0]);
normal1 = normalizeName(alias[1]);
links[normal0] = normal1;
names[normal0] = alias[0];
links[normal1] = normal0;
names[normal1] = alias[1];
}
}
function loadData (data) {
addZone(data.zones);
addLink(data.links);
tz.dataVersion = data.version;
}
function zoneExists (name) {
if (!zoneExists.didShowError) {
zoneExists.didShowError = true;
logError("moment.tz.zoneExists('" + name + "') has been deprecated in favor of !moment.tz.zone('" + name + "')");
}
return !!getZone(name);
}
function needsOffset (m) {
var isUnixTimestamp = (m._f === 'X' || m._f === 'x');
return !!(m._a && (m._tzm === undefined) && !isUnixTimestamp);
}
function logError (message) {
if (typeof console !== 'undefined' && typeof console.error === 'function') {
console.error(message);
}
}
/************************************
moment.tz namespace
************************************/
function tz (input) {
var args = Array.prototype.slice.call(arguments, 0, -1),
name = arguments[arguments.length - 1],
zone = getZone(name),
out = moment.utc.apply(null, args);
if (zone && !moment.isMoment(input) && needsOffset(out)) {
out.add(zone.parse(out), 'minutes');
}
out.tz(name);
return out;
}
tz.version = VERSION;
tz.dataVersion = '';
tz._zones = zones;
tz._links = links;
tz._names = names;
tz.add = addZone;
tz.link = addLink;
tz.load = loadData;
tz.zone = getZone;
tz.zoneExists = zoneExists; // deprecated in 0.1.0
tz.guess = guess;
tz.names = getNames;
tz.Zone = Zone;
tz.unpack = unpack;
tz.unpackBase60 = unpackBase60;
tz.needsOffset = needsOffset;
tz.moveInvalidForward = true;
tz.moveAmbiguousForward = false;
/************************************
Interface with Moment.js
************************************/
var fn = moment.fn;
moment.tz = tz;
moment.defaultZone = null;
moment.updateOffset = function (mom, keepTime) {
var zone = moment.defaultZone,
offset;
if (mom._z === undefined) {
if (zone && needsOffset(mom) && !mom._isUTC) {
mom._d = moment.utc(mom._a)._d;
mom.utc().add(zone.parse(mom), 'minutes');
}
mom._z = zone;
}
if (mom._z) {
offset = mom._z.utcOffset(mom);
if (Math.abs(offset) < 16) {
offset = offset / 60;
}
if (mom.utcOffset !== undefined) {
mom.utcOffset(-offset, keepTime);
} else {
mom.zone(offset, keepTime);
}
}
};
fn.tz = function (name, keepTime) {
if (name) {
if (typeof name !== 'string') {
throw new Error('Time zone name must be a string, got ' + name + ' [' + typeof name + ']');
}
this._z = getZone(name);
if (this._z) {
moment.updateOffset(this, keepTime);
} else {
logError("Moment Timezone has no data for " + name + ". See http://momentjs.com/timezone/docs/#/data-loading/.");
}
return this;
}
if (this._z) { return this._z.name; }
};
function abbrWrap (old) {
return function () {
if (this._z) { return this._z.abbr(this); }
return old.call(this);
};
}
function resetZoneWrap (old) {
return function () {
this._z = null;
return old.apply(this, arguments);
};
}
fn.zoneName = abbrWrap(fn.zoneName);
fn.zoneAbbr = abbrWrap(fn.zoneAbbr);
fn.utc = resetZoneWrap(fn.utc);
moment.tz.setDefault = function(name) {
if (major < 2 || (major === 2 && minor < 9)) {
logError('Moment Timezone setDefault() requires Moment.js >= 2.9.0. You are using Moment.js ' + moment.version + '.');
}
moment.defaultZone = name ? getZone(name) : null;
return moment;
};
// Cloning a moment should include the _z property.
var momentProperties = moment.momentProperties;
if (Object.prototype.toString.call(momentProperties) === '[object Array]') {
// moment 2.8.1+
momentProperties.push('_z');
momentProperties.push('_a');
} else if (momentProperties) {
// moment 2.7.0
momentProperties._z = null;
}
// INJECT DATA
return moment;
}));

84
nodejs/node_modules/moment-timezone/package.json generated vendored Executable file
View File

@ -0,0 +1,84 @@
{
"_args": [
[
"moment-timezone@0.5.23",
"/www/wwwroot/Adminx.cc/nodejs"
]
],
"_from": "moment-timezone@0.5.23",
"_id": "moment-timezone@0.5.23",
"_inBundle": false,
"_integrity": "sha512-WHFH85DkCfiNMDX5D3X7hpNH3/PUhjTGcD0U1SgfBGZxJ3qUmJh5FdvaFjcClxOvB3rzdfj4oRffbI38jEnC1w==",
"_location": "/moment-timezone",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "moment-timezone@0.5.23",
"name": "moment-timezone",
"escapedName": "moment-timezone",
"rawSpec": "0.5.23",
"saveSpec": null,
"fetchSpec": "0.5.23"
},
"_requiredBy": [
"/cron-parser"
],
"_resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.23.tgz",
"_spec": "0.5.23",
"_where": "/www/wwwroot/Adminx.cc/nodejs",
"author": {
"name": "Tim Wood",
"email": "washwithcare@gmail.com",
"url": "http://timwoodcreates.com/"
},
"bugs": {
"url": "https://github.com/moment/moment-timezone/issues"
},
"dependencies": {
"moment": ">= 2.9.0"
},
"description": "Parse and display moments in any timezone.",
"devDependencies": {
"grunt": "1.0.2",
"grunt-contrib-clean": "^1.1.0",
"grunt-contrib-jshint": "^1.1.0",
"grunt-contrib-nodeunit": "^1.0.0",
"grunt-contrib-uglify": "^3.1.0"
},
"engines": {
"node": "*"
},
"homepage": "http://momentjs.com/timezone/",
"jspm": {
"main": "builds/moment-timezone-with-data",
"shim": {
"moment-timezone": {
"deps": [
"moment"
]
}
}
},
"keywords": [
"moment",
"date",
"time",
"timezone",
"olson",
"iana",
"zone",
"tz"
],
"license": "MIT",
"main": "./index.js",
"name": "moment-timezone",
"repository": {
"type": "git",
"url": "git+https://github.com/moment/moment-timezone.git"
},
"scripts": {
"test": "grunt"
},
"version": "0.5.23"
}