Package Exports
- dateformater-plus
- dateformater-plus/index.js
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 (dateformater-plus) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
安装
npm install date-formater导入
在根组件或者main.js中,将方法绑定到Date的原型上
import dateFormaterPlus from 'dateFormater-plus'
window.Date.prototype.pattern=dateFormater.pattern
window.Date.prototype.getTimeRange=dateFormater.getTimeRange格式化时间
const timeStr=new Date().pattern('yyyy-MM-dd E HH:mm:ss')获取开始/结束时间数组
const timeArr=new Date().getTimeRange('week')
const timeArr=new Date('2021-08-01').getTimeRange('year')
......