We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 22e12b8 commit a1daf2bCopy full SHA for a1daf2b
src/client/theme-default/components/LastUpdated.vue
@@ -23,8 +23,11 @@ const prefix = computed(() => {
23
return p === true ? 'Last Updated' : p
24
})
25
26
-const datetime = computed(() => {
27
- return new Date(page.value.lastUpdated).toLocaleString('en-US')
+const datetime = ref('')
+onMounted(() => {
28
+ // locale string might be different based on end user
29
+ // and will lead to potential hydration mismatch if calculated at build time
30
+ datetime.value = new Date(page.value.lastUpdated).toLocaleString('en-US')
31
32
</script>
33
@@ -33,7 +36,7 @@ const datetime = computed(() => {
36
display: inline-block;
34
37
margin: 0;
35
38
line-height: 1.4;
- font-size: .9rem;
39
+ font-size: 0.9rem;
40
color: var(--c-text-light);
41
}
42
0 commit comments