Skip to content

Latest commit

 

History

History
25 lines (22 loc) · 485 Bytes

object-support.md

File metadata and controls

25 lines (22 loc) · 485 Bytes
id title
object-support
ObjectSupport

ObjectSupport extends dayjs(), dayjs.utc, dayjs().set, dayjs().add, dayjs().subtract APIs to support object argument.

var objectSupport = require("dayjs/plugin/objectSupport");
dayjs.extend(objectSupport);

dayjs({
  year: 2010,
  month: 1,
  day: 12
});
dayjs.utc({
  year: 2010,
  month: 1,
  day: 12
});
dayjs().set({ year: 2010, month: 1, day: 12 })
dayjs().add({ M: 1 })
dayjs().subtract({ month: 1 })