From f1fc698b58bd5b3d5d91fdcda61a7b137fa1acf3 Mon Sep 17 00:00:00 2001 From: Adrien Samson Date: Mon, 30 Jul 2018 17:49:58 +0200 Subject: [PATCH] Luxon: Interval.set allows partial object (#27526) * luxon: Interval.set allows partial object * luxon: fix Interval.merge/xor array notation --- types/luxon/index.d.ts | 8 ++++---- types/luxon/luxon-tests.ts | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/types/luxon/index.d.ts b/types/luxon/index.d.ts index 17706a9002..e96e389894 100644 --- a/types/luxon/index.d.ts +++ b/types/luxon/index.d.ts @@ -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; diff --git a/types/luxon/luxon-tests.ts b/types/luxon/luxon-tests.ts index de0aca9bfd..017f07b0c6 100644 --- a/types/luxon/luxon-tests.ts +++ b/types/luxon/luxon-tests.ts @@ -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();