mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-01 15:50:13 +00:00
Luxon: Interval.set allows partial object (#27526)
* luxon: Interval.set allows partial object * luxon: fix Interval.merge/xor array notation
This commit is contained in:
8
types/luxon/index.d.ts
vendored
8
types/luxon/index.d.ts
vendored
@@ -319,8 +319,8 @@ declare module 'luxon' {
|
||||
}
|
||||
|
||||
type IntervalObject = {
|
||||
start: DateTime;
|
||||
end: DateTime;
|
||||
start?: DateTime;
|
||||
end?: DateTime;
|
||||
};
|
||||
|
||||
class Interval {
|
||||
@@ -338,8 +338,8 @@ declare module 'luxon' {
|
||||
): Interval;
|
||||
static fromISO(string: string, options?: DateTimeOptions): Interval;
|
||||
static invalid(reason?: string): Interval;
|
||||
static merge(intervals: Interval[]): [Interval];
|
||||
static xor(intervals: Interval[]): [Interval];
|
||||
static merge(intervals: Interval[]): Interval[];
|
||||
static xor(intervals: Interval[]): Interval[];
|
||||
end: DateTime;
|
||||
invalidReason: string;
|
||||
isValid: boolean;
|
||||
|
||||
@@ -78,6 +78,7 @@ const i = Interval.fromDateTimes(now, later);
|
||||
i.length();
|
||||
i.length('years');
|
||||
i.contains(DateTime.local(2019));
|
||||
i.set({end: DateTime.local(2020)});
|
||||
|
||||
i.toISO();
|
||||
i.toString();
|
||||
|
||||
Reference in New Issue
Block a user