日期
One-Liner
两个日期之间的天数
const daysBetweenDates = (date1, date2) =>
Math.ceil(Math.abs(date1 - date2) / (1000 * 60 * 60 * 24));
工作日约会时间
const getWeekday = date =>
[
'Sunday',
'Monday',
'Tuesday',
'Wednesday',
'Thursday',
'Friday',
'Saturday',
][date.getDay()];
// or
const getWeekday = date => date.toLocaleString('en-US', {weekday: 'long'});