m6-date

0.0.6 • Public • Published

m6-date

增强js的Date对象,挂载新的api到Date下

安装

npm install m6-date

使用

import 'm6-date'

let time = new Date('2017/1/31')

time.offsetMonth(1) // Tue Feb 28 2017 00:00:00 GMT+0800 (CST)

time.offsetMonth(37) // Sat Feb 29 2020 00:00:00 GMT+0800 (CST)

time.offsetMonth(-1) // Sat Dec 31 2016 00:00:00 GMT+0800 (CST)

API

Date.prototype.offsetMonth(argument)

argument: Number
return: Date Object

Date.prototype.getMonthDays()

return: Number

Date.prototype.isValid()

return: Boolean

Package Sidebar

Install

npm i m6-date

Weekly Downloads

1

Version

0.0.6

License

MIT

Last publish

Collaborators

  • andself