Preview:
const calcDaysPassed = (date1, date2) =>
  Math.round(Math.abs((date2 - date1) / (1000 * 60 * 60 * 24)));

const day1 = calcDaysPassed(new Date(2037, 3, 14), new Date(2037, 3, 24));

//(1000 * 60 * 60 * 24) 1000milliseconds/sec 60sec/min 60min/hour 24hours/day
//Math.abs we use so that it doesn't matter which date is used first (remove -)
//Math.floor to remove decimals that occur if hours and minutes are included
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter