Weekday
Weekday 添加了 .weekday()
API 来获取或设置区域设置感知的一周中的某一天。
¥Weekday adds .weekday()
API to get or set locale aware day of the week.
var weekday = require("dayjs/plugin/weekday");
// import weekday from 'dayjs/plugin/weekday' // ES 2015
dayjs.extend(weekday);
// when Sunday is the first day of the week
dayjs().weekday(-7); // last Sunday
dayjs().weekday(7); // next Sunday
// when Monday is the first day of the week
dayjs().weekday(-7); // last Monday
dayjs().weekday(7); // next Monday