mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-20 23:16:49 +00:00
heo 添加最后更新日期,修复归档日期bug
This commit is contained in:
@@ -9,6 +9,7 @@ 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)
|
||||
// 如果格式是中文日期,则转为横杆
|
||||
const format = local.slice(0, 2).toLowerCase() === 'zh'
|
||||
? res.replace('年', '-').replace('月', '-').replace('日', '')
|
||||
: res
|
||||
|
||||
Reference in New Issue
Block a user