Day.js 中文文档

当前版本 v1.11

更多文档

Weekday

Weekday 添加了 .weekday() API 来获取或设置区域设置感知的一周中的某一天。

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

Day.js 中文文档 - 粤ICP备14034220号-1