Created
October 22, 2022 19:54
-
-
Save oguzhancvdr/50398a53ba7f718941e9d5f1461161de to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const dayDiff = (date1, date2) => Math.ceil(Math.abs(date1.getTime() - date2.getTime()) / 86400000); | |
dayDiff(new Date("2021-10-21"), new Date("2022-02-12")) | |
// Result: 114 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The number of days between two dates