diff --git a/backend/controllers/edit_task.go b/backend/controllers/edit_task.go index c60b61d2..a25f8788 100644 --- a/backend/controllers/edit_task.go +++ b/backend/controllers/edit_task.go @@ -85,6 +85,12 @@ func EditTaskHandler(w http.ResponseWriter, r *http.Request) { return } + entry, err = utils.ConvertISOToTaskwarriorFormat(entry) + if err != nil { + http.Error(w, fmt.Sprintf("Invalid entry date format: %v", err), http.StatusBadRequest) + return + } + logStore := models.GetLogStore() job := Job{ Name: "Edit Task", diff --git a/frontend/src/components/HomeComponents/Tasks/TaskDialog.tsx b/frontend/src/components/HomeComponents/Tasks/TaskDialog.tsx index 7b2e8e77..7310a9b6 100644 --- a/frontend/src/components/HomeComponents/Tasks/TaskDialog.tsx +++ b/frontend/src/components/HomeComponents/Tasks/TaskDialog.tsx @@ -1122,7 +1122,7 @@ export const TaskDialog = ({ {editState.isEditingEntryDate ? (
- + onDateTimeChange={(date, hasTime) => onUpdateState({ editedEntryDate: date - ? format(date, 'yyyy-MM-dd') + ? hasTime + ? date.toISOString() + : format(date, 'yyyy-MM-dd') : '', }) } + placeholder="Select entry date and time" /> diff --git a/frontend/src/components/HomeComponents/Tasks/__tests__/Tasks.test.tsx b/frontend/src/components/HomeComponents/Tasks/__tests__/Tasks.test.tsx index 6a400290..f47738a7 100644 --- a/frontend/src/components/HomeComponents/Tasks/__tests__/Tasks.test.tsx +++ b/frontend/src/components/HomeComponents/Tasks/__tests__/Tasks.test.tsx @@ -1105,7 +1105,7 @@ describe('Tasks Component', () => { ['End', 'End:', 'Select end date and time'], ['Due', 'Due:', 'Select due date and time'], ['Start', 'Start:', 'Select start date and time'], - ['Entry', 'Entry:', 'Pick a date'], + ['Entry', 'Entry:', 'Select entry date and time'], ])('shows red when task %s date is edited', async (_, label, placeholder) => { render();