Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit b29c1b6

Browse files
committed
fix: solve invalid date on Safari
1 parent 1ae7489 commit b29c1b6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

global-components/BaseListLayout.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
<div class="ui-post-date" v-if="page.frontmatter.date">
2020
<ClockIcon/>
21-
<span>{{ new Date(page.frontmatter.date.trim()).toDateString() }}</span>
21+
<span>{{ resovlePostDate(page.frontmatter.date) }}</span>
2222
</div>
2323
</div>
2424
</div>
@@ -65,6 +65,10 @@
6565
}
6666
6767
return Vue.component(n) || Pagination
68+
},
69+
70+
resovlePostDate(date) {
71+
return new Date(date.replace(/\-/g, "/").trim()).toDateString()
6872
}
6973
}
7074
}

0 commit comments

Comments
 (0)