mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
🤖 Merge PR #46421 Remove moment-timezone from DefinitelyTyped by @chivesrs
This commit is contained in:
parent
9844965e6b
commit
b3a2e2cabe
@ -2928,6 +2928,12 @@
|
||||
"sourceRepoURL": "https://github.com/rotaready/moment-range",
|
||||
"asOfVersion": "4.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "moment-timezone",
|
||||
"typingsPackageName": "moment-timezone",
|
||||
"sourceRepoURL": "https://github.com/moment/moment-timezone",
|
||||
"asOfVersion": "0.5.30"
|
||||
},
|
||||
{
|
||||
"libraryName": "mongodb-memory-server",
|
||||
"typingsPackageName": "mongodb-memory-server",
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"moment": "^2.18.1"
|
||||
"moment": "^2.18.1",
|
||||
"moment-timezone": ">=0.5.30"
|
||||
}
|
||||
}
|
||||
|
||||
12
types/moment-timezone/index.d.ts
vendored
12
types/moment-timezone/index.d.ts
vendored
@ -1,12 +0,0 @@
|
||||
// Type definitions for moment-timezone.js 0.5
|
||||
// Project: http://momentjs.com/timezone/
|
||||
// Definitions by: Michel Salib <https://github.com/michelsalib>
|
||||
// Alan Brazil Lins <https://github.com/alanblins>
|
||||
// Agustin Carrasco <https://github.com/asermax>
|
||||
// Borys Kupar <https://github.com/borys-kupar>
|
||||
// Anthony Rainer <https://github.com/pristinesource>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import moment = require('./moment-timezone');
|
||||
|
||||
export = moment;
|
||||
@ -1,103 +0,0 @@
|
||||
import moment = require('moment-timezone');
|
||||
|
||||
const june = moment('2014-06-01T12:00:00Z');
|
||||
june.tz('America/Los_Angeles').format('ha z');
|
||||
|
||||
const a = moment.tz('2013-11-18 11:55', 'America/Toronto');
|
||||
const b = moment.tz('May 12th 2014 8PM', 'MMM Do YYYY hA', 'America/Toronto');
|
||||
const c = moment.tz(1403454068850, 'America/Toronto');
|
||||
const d = moment.tz('May 12th 2014 8PM', 'MMM Do YYYY hA', true, 'America/Toronto');
|
||||
|
||||
a.tz();
|
||||
|
||||
const num = 1367337600000;
|
||||
const arr = [2013, 5, 1];
|
||||
const str = '2013-12-01';
|
||||
const date = new Date(2013, 4, 1);
|
||||
const mo = moment([2013, 4, 1]);
|
||||
const obj = { year : 2013, month : 5, day : 1 };
|
||||
const format = 'YYYY-MM-DD';
|
||||
const formats = ['YYYY-MM-DD', 'YYYY/MM/DD'];
|
||||
const formatsIncludingSpecial = ['YYYY-MM-DD', moment.ISO_8601];
|
||||
const language = 'en';
|
||||
|
||||
moment.tz();
|
||||
moment.tz('America/Los_Angeles');
|
||||
moment.tz('America/Los_Angeles').tz('Asia/Tomsk', true);
|
||||
|
||||
moment.tz(num, 'America/Los_Angeles');
|
||||
moment.tz(arr, 'America/Los_Angeles');
|
||||
moment.tz(str, 'America/Los_Angeles');
|
||||
moment.tz(str, format, 'America/Los_Angeles');
|
||||
moment.tz(str, format, true, 'America/Los_Angeles');
|
||||
moment.tz(str, format, language, 'America/Los_Angeles');
|
||||
moment.tz(str, format, language, true, 'America/Los_Angeles');
|
||||
moment.tz(str, formats, 'America/Los_Angeles');
|
||||
moment.tz(str, formats, true, 'America/Los_Angeles');
|
||||
moment.tz(str, formats, language, 'America/Los_Angeles');
|
||||
moment.tz(str, formats, language, true, 'America/Los_Angeles');
|
||||
moment.tz(str, moment.ISO_8601, 'America/Los_Angeles');
|
||||
moment.tz(str, moment.ISO_8601, true, 'America/Los_Angeles');
|
||||
moment.tz(str, moment.ISO_8601, language, 'America/Los_Angeles');
|
||||
moment.tz(str, moment.ISO_8601, language, true, 'America/Los_Angeles');
|
||||
moment.tz(str, formatsIncludingSpecial, 'America/Los_Angeles');
|
||||
moment.tz(str, formatsIncludingSpecial, true, 'America/Los_Angeles');
|
||||
moment.tz(str, formatsIncludingSpecial, language, 'America/Los_Angeles');
|
||||
moment.tz(str, formatsIncludingSpecial, language, true, 'America/Los_Angeles');
|
||||
|
||||
moment.tz(date, 'America/Los_Angeles');
|
||||
moment.tz(mo, 'America/Los_Angeles');
|
||||
moment.tz(obj, 'America/Los_Angeles');
|
||||
|
||||
const zone1: moment.MomentZone | null = moment.tz.zone('America/Los_Angeles');
|
||||
if (zone1 != null) {
|
||||
zone1.abbr(1403465838805);
|
||||
zone1.utcOffset(1403465838805);
|
||||
}
|
||||
|
||||
const zone2: moment.MomentZone | null = moment.tz.zone('America/New_York');
|
||||
if (zone2 != null) {
|
||||
zone2.parse(Date.UTC(2012, 2, 19, 8, 30)); // 240
|
||||
}
|
||||
|
||||
moment.tz.add('America/Los_Angeles|PST PDT|80 70|0101|1Lzm0 1zb0 Op0');
|
||||
moment.tz.add([
|
||||
'America/Los_Angeles|PST PDT|80 70|0101|1Lzm0 1zb0 Op0',
|
||||
'America/New_York|EST EDT|50 40|0101|1Lz50 1zb0 Op0'
|
||||
]);
|
||||
|
||||
moment.tz.link('America/Los_Angeles|US/Pacific');
|
||||
moment.tz.link([
|
||||
'America/Los_Angeles|US/Pacific',
|
||||
'America/New_York|US/Eastern'
|
||||
]);
|
||||
|
||||
moment.tz.load({
|
||||
zones : [],
|
||||
links : [],
|
||||
version : '2014e'
|
||||
});
|
||||
|
||||
moment.tz.names();
|
||||
|
||||
moment.tz.setDefault('America/Los_Angeles');
|
||||
|
||||
moment.tz.setDefault();
|
||||
|
||||
moment.tz.guess();
|
||||
|
||||
moment.tz.guess(true);
|
||||
|
||||
const zoneAbbr: string = moment.tz('America/Los_Angeles').zoneAbbr();
|
||||
|
||||
const zoneName: string = moment.tz('America/Los_Angeles').zoneName();
|
||||
|
||||
const zoneType: string | undefined = moment.tz('2013-11-18 11:55').tz();
|
||||
|
||||
const zones1: string[] = moment.tz.zonesForCountry('US');
|
||||
|
||||
const zones2: moment.MomentZoneOffset[] = moment.tz.zonesForCountry('CN', true);
|
||||
|
||||
const zones3: string[] = moment.tz.zonesForCountry('GB', false);
|
||||
|
||||
const countries: string[] = moment.tz.countries();
|
||||
67
types/moment-timezone/moment-timezone.d.ts
vendored
67
types/moment-timezone/moment-timezone.d.ts
vendored
@ -1,67 +0,0 @@
|
||||
import moment = require('moment');
|
||||
|
||||
// require("moment-timezone") === require("moment")
|
||||
export = moment;
|
||||
|
||||
declare module 'moment' {
|
||||
interface MomentZone {
|
||||
name: string;
|
||||
abbrs: string[];
|
||||
untils: number[];
|
||||
offsets: number[];
|
||||
population: number;
|
||||
|
||||
abbr(timestamp: number): string;
|
||||
offset(timestamp: number): number;
|
||||
utcOffset(timestamp: number): number;
|
||||
parse(timestamp: number): number;
|
||||
}
|
||||
|
||||
interface MomentZoneOffset {
|
||||
name: string;
|
||||
offset: number;
|
||||
}
|
||||
|
||||
interface MomentTimezone {
|
||||
(): moment.Moment;
|
||||
(timezone: string): moment.Moment;
|
||||
(date: number, timezone: string): moment.Moment;
|
||||
(date: number[], timezone: string): moment.Moment;
|
||||
(date: string, timezone: string): moment.Moment;
|
||||
(date: string, format: moment.MomentFormatSpecification, timezone: string): moment.Moment;
|
||||
(date: string, format: moment.MomentFormatSpecification, strict: boolean, timezone: string): moment.Moment;
|
||||
(date: string, format: moment.MomentFormatSpecification, language: string, timezone: string): moment.Moment;
|
||||
(date: string, format: moment.MomentFormatSpecification, language: string, strict: boolean, timezone: string): moment.Moment;
|
||||
(date: Date, timezone: string): moment.Moment;
|
||||
(date: moment.Moment, timezone: string): moment.Moment;
|
||||
(date: any, timezone: string): moment.Moment;
|
||||
|
||||
zone(timezone: string): MomentZone | null;
|
||||
|
||||
add(packedZoneString: string): void;
|
||||
add(packedZoneString: string[]): void;
|
||||
|
||||
link(packedLinkString: string): void;
|
||||
link(packedLinkString: string[]): void;
|
||||
|
||||
load(data: { version: string; links: string[]; zones: string[] }): void;
|
||||
|
||||
names(): string[];
|
||||
zonesForCountry<T extends true>(country: string, with_offset: T): T extends true ? MomentZoneOffset[] : never;
|
||||
zonesForCountry<T extends false>(country: string, with_offset?: T): T extends false ? string[] : never;
|
||||
zonesForCountry(country: string, with_offset?: boolean): MomentZoneOffset[] | string[];
|
||||
countries(): string[];
|
||||
guess(ignoreCache?: boolean): string;
|
||||
|
||||
setDefault(timezone?: string): Moment;
|
||||
}
|
||||
|
||||
interface Moment {
|
||||
tz(): string | undefined;
|
||||
tz(timezone: string, keepLocalTime?: boolean): moment.Moment;
|
||||
zoneAbbr(): string;
|
||||
zoneName(): string;
|
||||
}
|
||||
|
||||
const tz: MomentTimezone;
|
||||
}
|
||||
@ -1,23 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"moment-timezone-tests.ts"
|
||||
]
|
||||
}
|
||||
@ -1,8 +0,0 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"no-outside-dependencies": false,
|
||||
"no-unnecessary-qualifier": false,
|
||||
"unified-signatures": false
|
||||
}
|
||||
}
|
||||
2
types/react-date-range/index.d.ts
vendored
2
types/react-date-range/index.d.ts
vendored
@ -6,7 +6,7 @@
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import * as React from "react";
|
||||
import * as moment from "moment-timezone";
|
||||
import * as moment from "moment";
|
||||
|
||||
export type AnyDate = string | moment.Moment;
|
||||
export type DateFunc = (now: moment.Moment) => AnyDate;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user