fix: default task deadline to date only
ci / docker (push) Successful in 4m33s

This commit is contained in:
2026-09-08 09:24:00 +08:00
parent 113791229a
commit 972c4e1fb8
9 changed files with 68 additions and 12 deletions
+2 -2
View File
@@ -63,9 +63,9 @@ describe('task utilities', () => {
expect(filterTasks(searchable, '工作').map((task) => task.id)).toEqual(['4'])
})
it('defaults new tasks to today at noon in local time', () => {
it('defaults new tasks to today without a time', () => {
const due = defaultTaskDueAt(new Date(2026, 8, 8, 21, 30))
expect(due).toBe('2026-09-08T12:00')
expect(due).toBe('2026-09-08')
})
it('formats API dates in local wall-clock time', () => {
+1 -1
View File
@@ -148,7 +148,7 @@ export function defaultTaskDueAt(now = new Date()) {
const year = now.getFullYear()
const month = `${now.getMonth() + 1}`.padStart(2, '0')
const day = `${now.getDate()}`.padStart(2, '0')
return `${year}-${month}-${day}T12:00`
return `${year}-${month}-${day}`
}
export function toDateTimeLocal(value: string | null | undefined) {