Skip to content

Commit

Permalink
fix: revert datetime handling
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Dec 29, 2020
1 parent 22e12b8 commit a1daf2b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/client/theme-default/components/LastUpdated.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ const prefix = computed(() => {
return p === true ? 'Last Updated' : p
})
const datetime = computed(() => {
return new Date(page.value.lastUpdated).toLocaleString('en-US')
const datetime = ref('')
onMounted(() => {
// locale string might be different based on end user
// and will lead to potential hydration mismatch if calculated at build time
datetime.value = new Date(page.value.lastUpdated).toLocaleString('en-US')
})
</script>

Expand All @@ -33,7 +36,7 @@ const datetime = computed(() => {
display: inline-block;
margin: 0;
line-height: 1.4;
font-size: .9rem;
font-size: 0.9rem;
color: var(--c-text-light);
}
Expand Down

0 comments on commit a1daf2b

Please sign in to comment.