WeekYear
WeekYear 增加了 .weekYear()
API 来获取基于当前语言的按周计算的年份。
var weekYear = require("dayjs/plugin/weekYear"); // dependent on weekOfYear plugin
// import weekYear from 'dayjs/plugin/weekYear' // ES 2015
var weekOfYear = require("dayjs/plugin/weekOfYear");
// import weekOfYear from 'dayjs/plugin/weekOfYear' // ES 2015
dayjs.extend(weekOfYear);
dayjs.extend(weekYear);
dayjs().weekYear();