task#13769,时间测试
This commit is contained in:
@ -5,7 +5,13 @@ const formatDate = date => {
|
||||
const day = tempDate.getDate()
|
||||
return `${[year, month, day].map(formatNumber).join('-')}`
|
||||
}
|
||||
|
||||
const formatDate1 = date => {
|
||||
let tempDate = new Date(date)
|
||||
const year = tempDate.getFullYear()
|
||||
const month = tempDate.getMonth() + 1
|
||||
const day = tempDate.getDate()
|
||||
return `${[year, month, day].map(formatNumber).join('/')}`
|
||||
}
|
||||
const formatNumber = n => {
|
||||
n = n.toString()
|
||||
return n[1] ? n : `0${n}`
|
||||
@ -40,5 +46,6 @@ module.exports = {
|
||||
formatNumber,
|
||||
formatDate,
|
||||
leftCopy,
|
||||
timeFormat
|
||||
timeFormat,
|
||||
formatDate1
|
||||
}
|
||||
|
Reference in New Issue
Block a user