0.0.3 • Published 7 years ago

formattime v0.0.3

Weekly downloads
2
License
ISC
Repository
github
Last release
7 years ago

formattime

时间转换

☝️:npm install

✌️:npm test(测试用例)

👌: fixTime使用

  • @param originTime

    (String/Number)
  • @param format

    时间间隔按照从小到大顺序
    (Array)
      format:[{
         separate: -60*60*1000,
         formateStyle: '刚刚'
      }, {
         separate: -24*60*60*1000,
         formateStyle: '#{{hour}}小时前'
      }, {
         separate: -30*24*60*60*1000,
         formateStyle: '#{{day}}天前',
      },{
         separate: -Infinity,
         formateStyle: '#{{YYYY}}-#{{MM}}-#{{DD}} #{{HH}}:#{{mm}}',
      }]

🙋:自己试试吧!

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago