I'm currently working on this code snippet to calculate the difference between two dates, but unfortunately, I keep getting NaN as the output. Can anyone spot where I might be going wrong?
var start = "01/01/2018"; //dd/mm/yyyy format
var end = "09/01/2018"
var date1 = new Date(start);
var date2 = new Date(end);
var timeDiff = Math.abs(date1.getTime() - date2.getTime());
var diffDays = Math.ceil(parseInt((date2 - date1) / (24 * 3600 * 1000)));
alert(diffDays);