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:
Adrien Samson
2018-07-30 17:49:58 +02:00
committed by Andy
parent 3d30be9059
commit f1fc698b58
2 changed files with 5 additions and 4 deletions

View File

@@ -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;

View File

@@ -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();