Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,9 @@ export class NgxDateFnsDateAdapter extends DateAdapter<Date> {
}

const result = this._createDateWithOverflow(year, month, date);
const monthWithOverflow = this.options?.useUtc ? result.getUTCMonth() : result.getMonth();
// Check that the date wasn't above the upper bound for the month, causing the month to overflow
if (result.getMonth() !== month) {
if (monthWithOverflow !== month) {
throw Error(`Invalid date "${date}" for month with index "${month}".`);
}

Expand Down