mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-19 23:16:48 +00:00
feature:
日期格式;下划线
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user