Day.js 中文文档

当前版本 v1.11

更多文档

IsSameOrBefore

IsSameOrBefore 添加了 .isSameOrBefore() API 以返回 boolean 指示日期是否与另一个日期相同或早于另一个日期。

var isSameOrBefore = require("dayjs/plugin/isSameOrBefore");
// import isSameOrBefore from 'dayjs/plugin/isSameOrBefore' // ES 2015

dayjs.extend(isSameOrBefore);

dayjs("2010-10-20").isSameOrBefore("2010-10-19", "year");

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