mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 22:37:03 +00:00
Merge pull request #32164 from pietrovismara/master
[Luxon] Added DateTime.zone and Interval.mapEndpoints definitions
This commit is contained in:
Vendored
+4
-1
@@ -1,9 +1,10 @@
|
||||
// Type definitions for luxon 1.4
|
||||
// Type definitions for luxon 1.10
|
||||
// Project: https://github.com/moment/luxon#readme
|
||||
// Definitions by: Colby DeHart <https://github.com/colbydehart>
|
||||
// Hyeonseok Yang <https://github.com/FourwingsY>
|
||||
// Jonathan Siebern <https://github.com/jsiebern>
|
||||
// Matt R. Wilson <https://github.com/mastermatt>
|
||||
// Pietro Vismara <https://github.com/pietrovismara>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
@@ -225,6 +226,7 @@ declare module 'luxon' {
|
||||
weeksInWeekYear: number;
|
||||
year: number;
|
||||
zoneName: string;
|
||||
zone: Zone;
|
||||
diff(
|
||||
other: DateTime,
|
||||
unit?: DurationUnit | DurationUnit[],
|
||||
@@ -424,6 +426,7 @@ declare module 'luxon' {
|
||||
toISO(options?: ISOTimeOptions): string;
|
||||
toString(): string;
|
||||
union(other: Interval): Interval;
|
||||
mapEndpoints(cb: (d: DateTime) => DateTime): Interval;
|
||||
}
|
||||
|
||||
namespace Settings {
|
||||
|
||||
@@ -71,6 +71,8 @@ dt.plus({ hours: 3, minutes: 2 });
|
||||
dt.minus({ days: 7 });
|
||||
dt.startOf('day');
|
||||
dt.endOf('hour');
|
||||
dt.zone;
|
||||
dt.zoneName;
|
||||
|
||||
dt.set({ hour: 3 }).hour;
|
||||
|
||||
@@ -109,6 +111,7 @@ i.length();
|
||||
i.length('years');
|
||||
i.contains(DateTime.local(2019));
|
||||
i.set({end: DateTime.local(2020)});
|
||||
i.mapEndpoints((d) => d);
|
||||
|
||||
i.toISO();
|
||||
i.toString();
|
||||
|
||||
Reference in New Issue
Block a user