Last active
April 13, 2020 18:01
-
-
Save jorge8168711/9f05006b63933e9430cb555d302e3286 to your computer and use it in GitHub Desktop.
Function for get amount of days between two dates
This file contains hidden or 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
| /** | |
| * | |
| * @param {Date} startDate | |
| * @param {Date} endDate | |
| * @returns {number} | |
| */ | |
| function getAmountOfDays(startDate, endDate) { | |
| return Math.round((endDate.getTime() - startDate.getTime()) / (1000 * 3600 * 24) + 1); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment