QuarterOfYear
QuarterOfYear 添加了 .quarter()
API 以返回一年中的哪个季度属于某个日期,并扩展了 .add
.subtract
.startOf
.endOf
API 以支持单位 quarter
。
¥QuarterOfYear adds .quarter()
API to return to which quarter of the year belongs a date, and extends .add
.subtract
.startOf
.endOf
APIs to support unit quarter
.
var quarterOfYear = require("dayjs/plugin/quarterOfYear");
// import quarterOfYear from 'dayjs/plugin/quarterOfYear' // ES 2015
dayjs.extend(quarterOfYear);
dayjs("2010-04-01").quarter(); // 2
dayjs("2010-04-01").quarter(2);