Skip to content

Commit

Permalink
valueof - same thing but better
Browse files Browse the repository at this point in the history
  • Loading branch information
MikesGlitch committed Oct 9, 2023
1 parent 61a2775 commit e22c381
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ export default function DateSelect({
setValue(selectedValue || '');

let date = parse(selectedValue, dateFormat, new Date());
if (date instanceof Date && !isNaN(date.getTime())) {
if (date instanceof Date && !isNaN(date.valueOf())) {
onSelect(format(date, 'yyyy-MM-dd'));
}
}
Expand Down

0 comments on commit e22c381

Please sign in to comment.