Package Exports
- m6-date
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (m6-date) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
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