12345678910111213141516171819202122232425262728293031323334 |
- const globalData = {
- publicUrl: 'https://sqdx.jiaxintech.com'//测试地址
- // publicUrl: 'https://sqpx.jiaxintech.com'//正式地址
- // publicUrl:'http://10.16.10.139'//ly
- // publicUrl:'http://10.16.4.19:80'//hyb
- // publicUrl:'http://10.16.4.26:80'//zxq
- // publicUrl:'http://10.20.1.207:80'//dailin
- };
- const formatTime = date => {
- const year = date.getFullYear()
- const month = date.getMonth() + 1
- const day = date.getDate()
- const hour = date.getHours()
- const minute = date.getMinutes()
- const second = date.getSeconds()
- return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
- }
- const formatNumber = n => {
- n = n.toString()
- return n[1] ? n : '0' + n
- }
- const dateFilter=function(date){
- return date.replace(/([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})/g,function(){
- return arguments[1]+"年"+(arguments[2].length>1&&arguments[2][0]=="0"?arguments[2][1]:arguments[2])+"月"+(arguments[3].length>1&&arguments[3][0]=="0"?arguments[3][1]:arguments[3])+"日";
- })
-
- }
- module.exports = {
- globalData,
- formatTime,
- dateFilter
- }
|