返回两个日期之间的差异 (以天为值)。
计算Date
对象之间的差异 (以天为)。
const getDaysDiffBetweenDates = (dateInitial, dateFinal) => (dateFinal - dateInitial) / (1000 * 3600 * 24);
// getDaysDiffBetweenDates(new Date("2017-12-13"), new Date("2017-12-22")) -> 9
Copyright© 2013-2020
All Rights Reserved 京ICP备2023019179号-8