Commit 6725a269 authored by nature's avatar nature

Safari date处理

parent 4fd732d5
...@@ -40,6 +40,9 @@ export default (Vue) => { ...@@ -40,6 +40,9 @@ export default (Vue) => {
return `${YYYY}-${format(MM)}-${format(DD)} ${format(hh)}:${format(mm)}:${format(ss)}` return `${YYYY}-${format(MM)}-${format(DD)} ${format(hh)}:${format(mm)}:${format(ss)}`
}) })
Vue.filter('date', (dateTime, format) => { Vue.filter('date', (dateTime, format) => {
if (Object.prototype.toString.call(dateTime) === '[object String]' && dateTime.indexOf('T') === -1) {
dateTime = dateTime.replace(/-/g, '/')
}
const date = new Date(dateTime) const date = new Date(dateTime)
return date.format(format) return date.format(format)
}) })
......
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