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 daysBetween = ( date1, date2 ) => { | |
//Get 1 day in milliseconds | |
let one_day=1000*60*60*24; | |
// Convert both dates to milliseconds | |
let date1_ms = date1.getTime(); | |
let date2_ms = date2.getTime(); | |
// Calculate the difference in milliseconds | |
let difference_ms = date2_ms - date1_ms; |