IB
Size: a a a
IB
j
IB
const getDaysBetweenDates = (StartDate, EndDate) => {
const oneDay = 24 * 60 * 60 * 1000; // hours*minutes*seconds*milliseconds
const start = new Date(StartDate).getTime()
console.log(start);
const end = new Date(EndDate).getTime()
console.log((start - end) / oneDay);
return (start - end) / oneDay;
};
getDaysBetweenDates('1-1-2020', '1-2-2020'); // -> 1
ГФ
ГФ
ГФ
j
const getDaysBetweenDates = (StartDate, EndDate) => {
const oneDay = 24 * 60 * 60 * 1000; // hours*minutes*seconds*milliseconds
const start = new Date(StartDate).getTime()
console.log(start);
const end = new Date(EndDate).getTime()
console.log((start - end) / oneDay);
return (start - end) / oneDay;
};
getDaysBetweenDates('1-1-2020', '1-2-2020'); // -> 1
const getDaysBetweenDates = (startDate, endDate) => {
const oneDay = 24 * 60 * 60 * 1000
const start = new Date(startDate)
const end = new Date(endDate)
const diff = Math.abs(start - end)
return Math.ceil(diff / oneDay)
}
VB
const getDaysBetweenDates = (startDate, endDate) => {
const oneDay = 24 * 60 * 60 * 1000
const start = new Date(startDate)
const end = new Date(endDate)
const diff = Math.abs(start - end)
return Math.ceil(diff / oneDay)
}
IB
const getDaysBetweenDates = (startDate, endDate) => {
const oneDay = 24 * 60 * 60 * 1000
const start = new Date(startDate)
const end = new Date(endDate)
const diff = Math.abs(start - end)
return Math.ceil(diff / oneDay)
}
IB
j
j
🎈(
М
🎈(
j
j
IB
j