0.0.6 • Published 7 years ago

m6-date v0.0.6

Weekly downloads
-
License
MIT
Repository
-
Last release
7 years ago

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
0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago