luxon: added DateTime.zone and Interval.mapEndpoints

This commit is contained in:
Pietro Vismara
2019-01-21 11:52:34 +01:00
committed by pietrovismara
parent 945fd1a382
commit 1edaf7c618
2 changed files with 6 additions and 0 deletions
+3
View File
@@ -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 {
+3
View File
@@ -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();