dateformater-plus
v1.0.1
Published
提供了格式化时间、获取开始和结束时间相关的功能
Downloads
10
Maintainers
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')
......