showing results for - "javascript find the number of days between two days"
Niko
19 Apr 2020
1const dayDif = (date1, date2) => Math.ceil(Math.abs(date1.getTime() - date2.getTime()) / 86400000)
2
3dayDif(new Date("2020-10-21"), new Date("2021-10-22"))
4// Result: 366
5