fix: align task due dates to the right
ci / gitleaks (push) Successful in 7s
ci / docker (push) Successful in 3m34s

This commit is contained in:
2026-09-10 17:01:24 +08:00
parent 0345fbe73c
commit 1366f302ec
8 changed files with 183 additions and 24 deletions
@@ -34,7 +34,7 @@ describe('TaskDueDisplay', () => {
expect(time.textContent).toContain('今天')
expect(time.getAttribute('title')).toBe(time.getAttribute('aria-label'))
expect(time.getAttribute('title')).toContain('2026年9月10日')
expect(root.querySelector('svg')?.getAttribute('aria-hidden')).toBe('true')
expect(root.querySelector('svg')).toBeNull()
})
it('distinguishes incomplete overdue and completed neutral states', async () => {
+1 -3
View File
@@ -1,6 +1,5 @@
<script setup lang="ts">
import { computed } from 'vue'
import { CalendarDays } from 'lucide-vue-next'
import { getTaskDuePresentation } from '../lib/task-due'
const props = defineProps<{
@@ -15,7 +14,6 @@ const presentation = computed(() => getTaskDuePresentation(props))
<template>
<span v-if="presentation" class="task-due" :class="`task-due--${presentation.state}`">
<CalendarDays class="task-due__icon" aria-hidden="true" />
<time
class="task-due__text"
:datetime="presentation.datetime"
@@ -23,7 +21,7 @@ const presentation = computed(() => getTaskDuePresentation(props))
:aria-label="presentation.fullText"
>
<span class="task-due__absolute">{{ presentation.absoluteText }}</span>
<span aria-hidden="true"> · </span>
<span class="task-due__separator" aria-hidden="true"> · </span>
<span class="task-due__relative">{{ presentation.relativeText }}</span>
</time>
</span>