Commit 3bdbc79
committed
Fix Infinity validation in daysBetween
The function only checked for NaN, not Infinity. If the date string represented
an extreme date, getTime() could return Infinity, causing Math.round(Infinity)
to return Infinity.
Changed Number.isNaN() to Number.isFinite() to catch both NaN and Infinity.1 parent 7b65652 commit 3bdbc79
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
0 commit comments