mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 15:57:13 +00:00
luxon: added DateTime.zone and Interval.mapEndpoints
This commit is contained in:
committed by
pietrovismara
parent
945fd1a382
commit
1edaf7c618
Vendored
+3
@@ -4,6 +4,7 @@
|
||||
// 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
|
||||
|
||||
@@ -196,6 +197,7 @@ declare module 'luxon' {
|
||||
weeksInWeekYear: number;
|
||||
year: number;
|
||||
zoneName: string;
|
||||
zone: Zone;
|
||||
diff(
|
||||
other: DateTime,
|
||||
unit?: DurationUnit | DurationUnit[],
|
||||
@@ -393,6 +395,7 @@ declare module 'luxon' {
|
||||
toISO(options?: ISOTimeOptions): string;
|
||||
toString(): string;
|
||||
union(other: Interval): Interval;
|
||||
mapEndpoints(cb: (d: DateTime) => DateTime): Interval
|
||||
}
|
||||
|
||||
namespace Settings {
|
||||
|
||||
@@ -49,6 +49,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;
|
||||
|
||||
@@ -87,6 +89,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