fix for task dates update (#22)

This commit is contained in:
konrad 2019-03-03 20:56:00 +00:00 committed by Gitea
parent 4a8a1b0a24
commit 78abd2e88f
1 changed files with 4 additions and 4 deletions

View File

@ -17,9 +17,9 @@ export default class TaskService extends AbstractService {
beforeUpdate(model) {
// Convert the date in a unix timestamp
model.dueDate = (+ new Date(model.dueDate)) / 1000
model.startDate = (+ new Date(model.startDate)) / 1000
model.endDate = (+ new Date(model.endDate)) / 1000
model.dueDate = +new Date(model.dueDate) / 1000
model.startDate = +new Date(model.startDate) / 1000
model.endDate = +new Date(model.endDate) / 1000
// remove all nulls, these would create empty reminders
for (const index in model.reminderDates) {
@ -30,7 +30,7 @@ export default class TaskService extends AbstractService {
// Make normal timestamps from js dates
model.reminderDates = model.reminderDates.map(r => {
return Math.round(r / 1000)
return Math.round(+new Date(r) / 1000)
})
// Make the repeating amount to seconds