From 6c350faf7cbe98307663f940da906e24b47681fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90?= Date: Fri, 25 Nov 2022 16:57:34 +0800 Subject: [PATCH] feat: show full created time in tooltip --- components/status/StatusCard.vue | 9 ++++++--- components/status/StatusDetails.vue | 3 +-- composables/time.ts | 9 +++++++++ 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/components/status/StatusCard.vue b/components/status/StatusCard.vue index bc509fb6..5dea456f 100644 --- a/components/status/StatusCard.vue +++ b/components/status/StatusCard.vue @@ -36,6 +36,7 @@ function go() { router.push(getStatusPath(status)) } +const createdAt = useFormattedDateTime(status.createdAt) const timeago = useTimeAgo(() => status.createdAt, { showSecond: true, messages: { @@ -89,9 +90,11 @@ const timeago = useTimeAgo(() => status.createdAt, {
-
- {{ timeago }} -
+ +
+ {{ timeago }} +
+
diff --git a/components/status/StatusDetails.vue b/components/status/StatusDetails.vue index ad200c68..dc548e67 100644 --- a/components/status/StatusDetails.vue +++ b/components/status/StatusDetails.vue @@ -11,8 +11,7 @@ const status = $computed(() => { return props.status }) -const formatter = Intl.DateTimeFormat(undefined, { dateStyle: 'long' }) -const date = computed(() => formatter.format(new Date(status.createdAt))) +const date = useFormattedDateTime(status.createdAt)