Initial import from local backup (Documents-Playground/pakerpale)
This commit is contained in:
5
node_modules/tz-offset/Gemfile
generated
vendored
Normal file
5
node_modules/tz-offset/Gemfile
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
source "https://rubygems.org"
|
||||
|
||||
gem "tzinfo"
|
||||
gem "tzinfo-data"
|
||||
gem "activesupport"
|
||||
28
node_modules/tz-offset/Gemfile.lock
generated
vendored
Normal file
28
node_modules/tz-offset/Gemfile.lock
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
activesupport (5.2.1)
|
||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||
i18n (>= 0.7, < 2)
|
||||
minitest (~> 5.1)
|
||||
tzinfo (~> 1.1)
|
||||
concurrent-ruby (1.0.5)
|
||||
i18n (1.1.0)
|
||||
concurrent-ruby (~> 1.0)
|
||||
minitest (5.11.3)
|
||||
thread_safe (0.3.6)
|
||||
tzinfo (1.2.5)
|
||||
thread_safe (~> 0.1)
|
||||
tzinfo-data (1.2018.5)
|
||||
tzinfo (>= 1.0.0)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
activesupport
|
||||
tzinfo
|
||||
tzinfo-data
|
||||
|
||||
BUNDLED WITH
|
||||
1.16.2
|
||||
8
node_modules/tz-offset/generate.rb
generated
vendored
Normal file
8
node_modules/tz-offset/generate.rb
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
require 'active_support/all'
|
||||
|
||||
zones = Hash.new
|
||||
timezones = ActiveSupport::TimeZone.all.each { |tz|
|
||||
zones[tz.tzinfo.name] = tz.utc_offset / 60 * -1
|
||||
}
|
||||
|
||||
File.open("offsets.json", 'w') { |file| file.write(zones.to_json) }
|
||||
1
node_modules/tz-offset/generated/offsets.json
generated
vendored
Normal file
1
node_modules/tz-offset/generated/offsets.json
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"Etc/GMT+12":720,"Pacific/Pago_Pago":660,"Pacific/Midway":660,"Pacific/Honolulu":600,"America/Juneau":540,"America/Los_Angeles":480,"America/Tijuana":480,"America/Phoenix":420,"America/Chihuahua":420,"America/Mazatlan":420,"America/Denver":420,"America/Guatemala":360,"America/Chicago":360,"America/Mexico_City":360,"America/Monterrey":360,"America/Regina":360,"America/Bogota":300,"America/New_York":300,"America/Indiana/Indianapolis":300,"America/Lima":300,"America/Halifax":240,"America/Caracas":240,"America/Guyana":240,"America/La_Paz":240,"America/Puerto_Rico":240,"America/Santiago":240,"America/St_Johns":210,"America/Sao_Paulo":180,"America/Argentina/Buenos_Aires":180,"America/Godthab":180,"America/Montevideo":180,"Atlantic/South_Georgia":120,"Atlantic/Azores":60,"Atlantic/Cape_Verde":60,"Africa/Casablanca":0,"Europe/London":0,"Europe/Lisbon":0,"Africa/Monrovia":0,"Etc/UTC":0,"Europe/Amsterdam":-60,"Europe/Belgrade":-60,"Europe/Berlin":-60,"Europe/Zurich":-60,"Europe/Bratislava":-60,"Europe/Brussels":-60,"Europe/Budapest":-60,"Europe/Copenhagen":-60,"Europe/Dublin":-60,"Europe/Ljubljana":-60,"Europe/Madrid":-60,"Europe/Paris":-60,"Europe/Prague":-60,"Europe/Rome":-60,"Europe/Sarajevo":-60,"Europe/Skopje":-60,"Europe/Stockholm":-60,"Europe/Vienna":-60,"Europe/Warsaw":-60,"Africa/Algiers":-60,"Europe/Zagreb":-60,"Europe/Athens":-120,"Europe/Bucharest":-120,"Africa/Cairo":-120,"Africa/Harare":-120,"Europe/Helsinki":-120,"Asia/Jerusalem":-120,"Europe/Kaliningrad":-120,"Europe/Kiev":-120,"Africa/Johannesburg":-120,"Europe/Riga":-120,"Europe/Sofia":-120,"Europe/Tallinn":-120,"Europe/Vilnius":-120,"Asia/Baghdad":-180,"Europe/Istanbul":-180,"Asia/Kuwait":-180,"Europe/Minsk":-180,"Europe/Moscow":-180,"Africa/Nairobi":-180,"Asia/Riyadh":-180,"Europe/Volgograd":-180,"Asia/Tehran":-210,"Asia/Muscat":-240,"Asia/Baku":-240,"Europe/Samara":-240,"Asia/Tbilisi":-240,"Asia/Yerevan":-240,"Asia/Kabul":-270,"Asia/Yekaterinburg":-300,"Asia/Karachi":-300,"Asia/Tashkent":-300,"Asia/Kolkata":-330,"Asia/Colombo":-330,"Asia/Kathmandu":-345,"Asia/Almaty":-360,"Asia/Dhaka":-360,"Asia/Urumqi":-360,"Asia/Rangoon":-390,"Asia/Bangkok":-420,"Asia/Jakarta":-420,"Asia/Krasnoyarsk":-420,"Asia/Novosibirsk":-420,"Asia/Shanghai":-480,"Asia/Chongqing":-480,"Asia/Hong_Kong":-480,"Asia/Irkutsk":-480,"Asia/Kuala_Lumpur":-480,"Australia/Perth":-480,"Asia/Singapore":-480,"Asia/Taipei":-480,"Asia/Ulaanbaatar":-480,"Asia/Tokyo":-540,"Asia/Seoul":-540,"Asia/Yakutsk":-540,"Australia/Adelaide":-570,"Australia/Darwin":-570,"Australia/Brisbane":-600,"Australia/Melbourne":-600,"Pacific/Guam":-600,"Australia/Hobart":-600,"Pacific/Port_Moresby":-600,"Australia/Sydney":-600,"Asia/Vladivostok":-600,"Asia/Magadan":-660,"Pacific/Noumea":-660,"Pacific/Guadalcanal":-660,"Asia/Srednekolymsk":-660,"Pacific/Auckland":-720,"Pacific/Fiji":-720,"Asia/Kamchatka":-720,"Pacific/Majuro":-720,"Pacific/Chatham":-765,"Pacific/Tongatapu":-780,"Pacific/Apia":-780,"Pacific/Fakaofo":-780}
|
||||
61
node_modules/tz-offset/package.json
generated
vendored
Normal file
61
node_modules/tz-offset/package.json
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"_from": "tz-offset@0.0.1",
|
||||
"_id": "tz-offset@0.0.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-kMBmblijHJXyOpKzgDhKx9INYU4u4E1RPMB0HqmKSgWG8vEcf3exEfLh4FFfzd3xdQOw9EuIy/cP0akY6rHopQ==",
|
||||
"_location": "/tz-offset",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "tz-offset@0.0.1",
|
||||
"name": "tz-offset",
|
||||
"escapedName": "tz-offset",
|
||||
"rawSpec": "0.0.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "0.0.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/node-cron"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/tz-offset/-/tz-offset-0.0.1.tgz",
|
||||
"_shasum": "fef920257024d3583ed9072a767721a18bdb8a76",
|
||||
"_spec": "tz-offset@0.0.1",
|
||||
"_where": "D:\\dev\\xmap\\cm-melon\\node_modules\\node-cron",
|
||||
"author": {
|
||||
"name": "Lucas Merencia",
|
||||
"email": "lucas@merencia.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/merencia/tz-offset/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "Javascript Timezone Offset",
|
||||
"devDependencies": {
|
||||
"chai": "^4.1.2",
|
||||
"mocha": "^5.2.0",
|
||||
"nyc": "^12.0.2"
|
||||
},
|
||||
"directories": {
|
||||
"test": "test"
|
||||
},
|
||||
"homepage": "https://github.com/merencia/tz-offset#readme",
|
||||
"keywords": [
|
||||
"timezone",
|
||||
"offset",
|
||||
"time",
|
||||
"zone"
|
||||
],
|
||||
"license": "ISC",
|
||||
"main": "src/tz-offset.js",
|
||||
"name": "tz-offset",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/merencia/tz-offset.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "nyc --reporter=html --reporter=text mocha --recursive"
|
||||
},
|
||||
"version": "0.0.1"
|
||||
}
|
||||
30
node_modules/tz-offset/src/tz-offset.js
generated
vendored
Normal file
30
node_modules/tz-offset/src/tz-offset.js
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
var offsets = require("../generated/offsets");
|
||||
|
||||
module.exports = (function() {
|
||||
|
||||
function offsetOf(timezone){
|
||||
var offset = offsets[timezone];
|
||||
if(offset != undefined && offset != null){
|
||||
return offset;
|
||||
} else {
|
||||
throw Error("Invalid timezone "+ timezone);
|
||||
}
|
||||
}
|
||||
|
||||
function removeOffset(date){
|
||||
var currentOffset = date.getTimezoneOffset() * -60000;
|
||||
return date.getTime() - currentOffset;
|
||||
}
|
||||
|
||||
function timeAt(date, timezone){
|
||||
let timeUtc = removeOffset(date);
|
||||
var offset = offsetOf(timezone) * -60000;
|
||||
return new Date(timeUtc + offset);
|
||||
}
|
||||
|
||||
return {
|
||||
offsetOf: offsetOf,
|
||||
removeOffset: removeOffset,
|
||||
timeAt: timeAt
|
||||
};
|
||||
})();
|
||||
38
node_modules/tz-offset/test/tz-offset-test.js
generated
vendored
Normal file
38
node_modules/tz-offset/test/tz-offset-test.js
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
let tzOffset = require("../src/tz-offset");
|
||||
let {assert} = require("chai");
|
||||
|
||||
process.env.TZ= "America/Sao_Paulo";
|
||||
|
||||
describe("tz-offset", () => {
|
||||
it("should return 180 to America/Sao_Paulo", () => {
|
||||
assert.equal(tzOffset.offsetOf("America/Sao_Paulo"), 180);
|
||||
});
|
||||
|
||||
it("should return -60 to Africa/Algiers", () => {
|
||||
assert.equal(tzOffset.offsetOf("Africa/Algiers"), -60);
|
||||
});
|
||||
|
||||
it("should return 0 to Europe/London", () => {
|
||||
assert.equal(tzOffset.offsetOf("Europe/London"), 0);
|
||||
});
|
||||
|
||||
it("should fail with invalid timezone", () => {
|
||||
assert.throws(() => {
|
||||
tzOffset.offsetOf("Invalid/Timezone");
|
||||
}, Error, "Invalid timezone Invalid/Timezone");
|
||||
});
|
||||
|
||||
it("should remove current offset", () => {
|
||||
let date = new Date();
|
||||
utcTime = tzOffset.removeOffset(date);
|
||||
assert.equal(utcTime, date.getTime() + date.getTimezoneOffset() * 60000);
|
||||
});
|
||||
|
||||
it("should return the time at zone", () => {
|
||||
let date = new Date(2018, 8, 20, 0, 0, 0, 0);
|
||||
let expectedDate = new Date(2018, 8, 20, 3, 0, 0, 0);
|
||||
result = tzOffset.timeAt(date, "Etc/UTC");
|
||||
console.log(result);
|
||||
assert.equal(result.toString(), expectedDate.toString());
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user