fix: revert datetime handling

pull/198/head
Evan You 4 years ago
parent 22e12b8928
commit a1daf2b8a0

@ -23,8 +23,11 @@ const prefix = computed(() => {
return p === true ? 'Last Updated' : p return p === true ? 'Last Updated' : p
}) })
const datetime = computed(() => { const datetime = ref('')
return new Date(page.value.lastUpdated).toLocaleString('en-US') 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> </script>
@ -33,7 +36,7 @@ const datetime = computed(() => {
display: inline-block; display: inline-block;
margin: 0; margin: 0;
line-height: 1.4; line-height: 1.4;
font-size: .9rem; font-size: 0.9rem;
color: var(--c-text-light); color: var(--c-text-light);
} }

Loading…
Cancel
Save