This commit is contained in:
@@ -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', () => {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user