Fix changing task dates (due/start/end/reminders)

Fixes #71
This commit is contained in:
kolaente 2020-03-08 20:07:21 +01:00
parent ab8dd6f67a
commit a706089f7b
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B

View file

@ -31,9 +31,9 @@ export default class TaskService extends AbstractService {
model.listID = Number(model.listID)
// Convert dates into an iso string
model.dueDate = model.dueDate === null ? null : formatISO(model.dueDate)
model.startDate = model.startDate === null ? null : formatISO(model.startDate)
model.endDate = model.endDate === null ? null : formatISO(model.endDate)
model.dueDate = model.dueDate === null ? null : formatISO(new Date(model.dueDate))
model.startDate = model.startDate === null ? null : formatISO(new Date(model.startDate))
model.endDate = model.endDate === null ? null : formatISO(new Date(model.endDate))
model.created = formatISO(model.created)
model.updated = formatISO(model.updated)
@ -47,7 +47,7 @@ export default class TaskService extends AbstractService {
// Make normal timestamps from js dates
if(model.reminderDates.length > 0) {
model.reminderDates = model.reminderDates.map(r => {
return formatISO(r)
return formatISO(new Date(r))
})
}