ObjectSupport
ObjectSupport는 객체 인자를 지원하도록 dayjs()
, dayjs.utc
, dayjs().set
, dayjs().add
, dayjs().subtract
API를 확장합니다.
javascript
var objectSupport = require('dayjs/plugin/objectSupport');
// import objectSupport from 'dayjs/plugin/objectSupport' // ES 2015
dayjs.extend(objectSupport);
dayjs({
year: 2010, // Year
month: 1, // Month (1부터 시작)
day: 12, // Day
});
dayjs.utc({
year: 2010, // Year
month: 1, // Month (1부터 시작)
day: 12, // Day
});
dayjs().set({ year: 2010, month: 1, day: 12 });
dayjs().add({ M: 1 }); // 1개월 추가
dayjs().subtract({ month: 1 }); // 1개월 감소