feat: 最後量測時間
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
</div>
|
||||
</v-card-title>
|
||||
|
||||
<v-card-subtitle> 顯示目前帳號各測驗項目的最新成績。 </v-card-subtitle>
|
||||
<v-card-subtitle> 最後量測時間:{{ formattedReceivedAt }} </v-card-subtitle>
|
||||
|
||||
<v-card-text>
|
||||
<v-progress-linear
|
||||
@@ -86,6 +86,7 @@ const props = defineProps<{
|
||||
error: string;
|
||||
items: PhysicalFitnessItem[];
|
||||
loading: boolean;
|
||||
receivedAt: string | null;
|
||||
}>();
|
||||
|
||||
defineEmits<{
|
||||
@@ -125,6 +126,22 @@ const displayItems = computed(() =>
|
||||
const completedCount = computed(
|
||||
() => displayItems.value.filter((item) => item.fitnessScore !== null).length,
|
||||
);
|
||||
|
||||
const formattedReceivedAt = computed(() => {
|
||||
if (!props.receivedAt) {
|
||||
return "無資料";
|
||||
}
|
||||
|
||||
const receivedAt = new Date(props.receivedAt);
|
||||
if (Number.isNaN(receivedAt.getTime())) {
|
||||
return "無資料";
|
||||
}
|
||||
|
||||
return new Intl.DateTimeFormat("zh-TW", {
|
||||
dateStyle: "medium",
|
||||
timeStyle: "short",
|
||||
}).format(receivedAt);
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
Reference in New Issue
Block a user