mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 23:37:04 +00:00
bump version (#35288)
- added missing static methods for IANAZone and `FixedOffsetZone`.
This commit is contained in:
committed by
Nathan Shively-Sanders
parent
2c7b9c4735
commit
fadde892e8
Vendored
+16
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for luxon 1.12
|
||||
// Type definitions for luxon 1.13
|
||||
// Project: https://github.com/moment/luxon#readme
|
||||
// Definitions by: Colby DeHart <https://github.com/colbydehart>
|
||||
// Hyeonseok Yang <https://github.com/FourwingsY>
|
||||
@@ -6,6 +6,7 @@
|
||||
// Matt R. Wilson <https://github.com/mastermatt>
|
||||
// Pietro Vismara <https://github.com/pietrovismara>
|
||||
// Janeene Beeforth <https://github.com/dawnmist>
|
||||
// Jason Yu <https://github.com/ycmjason>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
@@ -507,4 +508,18 @@ export class Zone {
|
||||
|
||||
export class IANAZone extends Zone {
|
||||
constructor(ianaString: string);
|
||||
static create(name: string): IANAZone;
|
||||
static isValidSpecifier(s: string): boolean;
|
||||
static isValidZone(zone: string): boolean;
|
||||
static resetCache(): void;
|
||||
}
|
||||
|
||||
export class FixedOffsetZone extends Zone {
|
||||
static utcInstance: string;
|
||||
static instance(offset: number): FixedOffsetZone;
|
||||
static parseSpecifier(s: string): FixedOffsetZone;
|
||||
}
|
||||
|
||||
export class InvalidZone extends Zone { }
|
||||
|
||||
export class LocalZone extends Zone { }
|
||||
|
||||
@@ -4,6 +4,9 @@ import {
|
||||
Interval,
|
||||
Info,
|
||||
Settings,
|
||||
InvalidZone,
|
||||
LocalZone,
|
||||
FixedOffsetZone,
|
||||
IANAZone,
|
||||
Zone,
|
||||
ZoneOffsetOptions,
|
||||
@@ -23,10 +26,19 @@ const fromObject = DateTime.fromObject({
|
||||
});
|
||||
|
||||
const ianaZone = new IANAZone('America/Los_Angeles');
|
||||
IANAZone.create("Europe/London");
|
||||
IANAZone.isValidSpecifier("Europe/London");
|
||||
IANAZone.isValidZone("Europe/London");
|
||||
IANAZone.resetCache();
|
||||
const ianaZoneTest = DateTime.fromObject({
|
||||
zone: ianaZone,
|
||||
});
|
||||
|
||||
FixedOffsetZone.utcInstance;
|
||||
|
||||
FixedOffsetZone.instance(60);
|
||||
FixedOffsetZone.parseSpecifier("UTC+6");
|
||||
|
||||
const fromIso = DateTime.fromISO('2017-05-15'); // => May 15, 2017 at midnight
|
||||
const fromIso2 = DateTime.fromISO('2017-05-15T08:30:00'); // => May 15, 2017 at midnight
|
||||
|
||||
|
||||
Reference in New Issue
Block a user