IB
Size: a a a
IB
j
j
m
IB
IB
m
j
IB
IB
j
new Date(new Date())
просто пока проверь без этого.j
IB
j
j
IB
j
IB
j
IB
const getDaysBetweenDates = (date1, date2) => {
const MS_PER_DAY = 1000 * 60 * 60 * 24;
const a = new Date(date1)
const b = new Date(date2)
const utc1 = Date.UTC(a.getFullYear(), a.getMonth(), a.getDate());
const utc2 = Date.UTC(b.getFullYear(), b.getMonth(), b.getDate());
return Math.floor((utc2 - utc1) / MS_PER_DAY, 0);
};