Skip to content

Commit fa3e68d

Browse files
at-wrqwerzl
andauthored
fix(index): update greeting based on time ranges (#593)
Co-authored-by: Tom Tang <[email protected]>
1 parent 6b828c0 commit fa3e68d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pages/index.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ useHead({
1212

1313
<template>
1414
<div class="text-3xl font-bold">
15-
{{ $dayjs().hour() < 12 ? '早上好!' : ($dayjs().hour() < 18 ? '下午好!' : '晚上好!') }}
15+
{{
16+
$dayjs().hour() < 5 ? '晚上好!'
17+
: $dayjs().hour() < 12 ? '早上好!'
18+
: $dayjs().hour() < 13 ? '中午好!'
19+
: $dayjs().hour() < 18 ? '下午好!' : '晚上好!'
20+
}}
1621
</div>
1722
<div class="text-muted-foreground">
1823
Welcome to Enspire!

0 commit comments

Comments
 (0)