Skip to content

Commit

Permalink
Merge pull request #2408 from faatihi/patch-1
Browse files Browse the repository at this point in the history
Compare date types with strongly typed names
  • Loading branch information
Eonasdan authored Oct 3, 2021
2 parents 9927950 + a7b0679 commit 9e29391
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/js/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -441,8 +441,8 @@ export class OptionConverter {
* @private
*/
static _dateTypeCheck(d: any): DateTime | null {
if (d.constructor.name === 'DateTime') return d;
if (d.constructor.name === 'Date') {
if (d.constructor.name === DateTime.name) return d;
if (d.constructor.name === Date.name) {
return DateTime.convert(d);
}
if (typeof d === typeof '') {
Expand Down

0 comments on commit 9e29391

Please sign in to comment.