odejmowanie JavaScript 2 daty mają różnicę w minutach
var diff = Math.abs(new Date('2011/10/09 12:00') - new Date('2011/10/09 00:00'));
Determined Donkey
var diff = Math.abs(new Date('2011/10/09 12:00') - new Date('2011/10/09 00:00'));
const date1 = new Date('7/13/2010');
const date2 = new Date('12/15/2010');
const diffTime = Math.abs(date2 - date1);
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
console.log(diffDays + " days");