project init
This commit is contained in:
@@ -6,7 +6,14 @@ const formatTime = date => {
|
||||
const minute = date.getMinutes()
|
||||
const second = date.getSeconds()
|
||||
|
||||
return `${[year, month, day].map(formatNumber).join('/')} ${[hour, minute, second].map(formatNumber).join(':')}`
|
||||
return `${[year, month, day].map(formatNumber).join('-')} ${[hour, minute, second].map(formatNumber).join(':')}`
|
||||
}
|
||||
|
||||
const formatDate = date => {
|
||||
const year = date.getFullYear()
|
||||
const month = date.getMonth() + 1
|
||||
const day = date.getDate()
|
||||
return `${[year, month, day].map(formatNumber).join('-')}`
|
||||
}
|
||||
|
||||
const formatNumber = n => {
|
||||
@@ -15,5 +22,6 @@ const formatNumber = n => {
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
formatTime
|
||||
formatTime,
|
||||
formatDate
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user