Merge pull request #23681 from mribichich/master

moment-range: Updated add function to v3.1.1 to accept options object
This commit is contained in:
Daniel Rosenwasser 2018-02-16 16:06:22 -08:00 committed by GitHub
commit baf28ecc60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 11 deletions

View File

@ -1,4 +1,4 @@
// Type definitions for Moment-range.js 3.0
// Type definitions for Moment-range.js 3.1
// Project: https://github.com/gf3/moment-range
// Definitions by: Bart van den Burg <https://github.com/Burgov>
// Wilgert Velinga <https://github.com/wilgert>
@ -21,7 +21,7 @@ export class DateRange {
intersect(other: DateRange): DateRange;
add(other: DateRange): DateRange;
add(other: DateRange, options?: { adjacent?: boolean }): DateRange;
subtract(other: DateRange): DateRange[];

View File

@ -60,18 +60,20 @@ const it10: Iterable<moment.Moment> = range.reverseByRange(range, { exclusive: t
const it11: Iterable<moment.Moment> = range.reverseByRange(range, { exclusive: false, step: 2 });
const res23: momentRange.DateRange = range.add(range2);
const res24: momentRange.DateRange = range.add(range2, {adjacent: true});
const res25: momentRange.DateRange = range.add(range2, {adjacent: false});
const res24: momentRange.DateRange[] = range.subtract(range2);
const res26: momentRange.DateRange[] = range.subtract(range2);
const res25: Date[] = range.toDate();
const res27: Date[] = range.toDate();
const res26: string = range.toString();
const res28: string = range.toString();
const res27: number = range.valueOf();
const res29: number = range.valueOf();
const res28: moment.Moment = range.start;
const res29: moment.Moment = range.end;
const res30: moment.Moment = range.start;
const res31: moment.Moment = range.end;
const res30: boolean = extendedMoment.within(range);
const res31: boolean = extendedMoment().within(range);
const res32: momentRange.DateRange = extendedMoment().range(moment("2011-04-15", "YYYY-MM-DD"), moment("2011-11-27", "YYYY-MM-DD"));
const res32: boolean = extendedMoment.within(range);
const res33: boolean = extendedMoment().within(range);
const res34: momentRange.DateRange = extendedMoment().range(moment("2011-04-15", "YYYY-MM-DD"), moment("2011-11-27", "YYYY-MM-DD"));