This commit is contained in:
tangly1024.com
2023-06-30 14:28:15 +08:00
parent 96908a9290
commit 0f7e5f2fb9
26 changed files with 74 additions and 75 deletions

View File

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