Commit 258fac50 authored by youjie's avatar youjie

no message

parent ee797370
......@@ -206,6 +206,26 @@ function GetDateFewFaysLater(Days){
}
}
export const formatDate = (date, fmt) => {
if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
}
let o = {
'M+': date.getMonth() + 1,
'd+': date.getDate(),
'h+': date.getHours(),
'm+': date.getMinutes(),
's+': date.getSeconds()
}
for (let k in o) {
if (new RegExp(`(${k})`).test(fmt)) {
let str = o[k] + ''
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : padLeftZero(str))
}
}
return fmt
}
export default {
calcContentHeight,
SystemInfo,
......@@ -217,5 +237,6 @@ export default {
VersionUpdate,
formatDates,
setAttatchParameter,
GetDateFewFaysLater
GetDateFewFaysLater,
formatDate
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment