日期格式;下划线
This commit is contained in:
tangly1024
2021-12-24 17:35:40 +08:00
parent ef324c2275
commit 0cf638069b
2 changed files with 4 additions and 9 deletions

View File

@@ -9,7 +9,7 @@ export default function formatDate (date, local) {
const options = { year: 'numeric', month: 'short', day: 'numeric' }
const res = d.toLocaleDateString(local, options)
return local.slice(0, 2).toLowerCase() === 'zh'
? res.replace('年', '').replace('月', '').replace('日', '')
? res.replace('年', '-').replace('月', '-').replace('日', '')
: res
}