1
0

feat: Use new Reminders API instead of reminder_dates

This commit is contained in:
ce72
2023-03-11 19:20:07 +01:00
committed by kolaente
parent 8a75790453
commit f747d5b2fc
8 changed files with 60 additions and 34 deletions

View File

@ -54,17 +54,17 @@ export default class TaskService extends AbstractService<ITask> {
model.created = new Date(model.created).toISOString()
model.updated = new Date(model.updated).toISOString()
model.reminderDates = null
// remove all nulls, these would create empty reminders
for (const index in model.reminderDates) {
if (model.reminderDates[index] === null) {
model.reminderDates.splice(index, 1)
for (const index in model.reminders) {
if (model.reminders[index] === null) {
model.reminders.splice(index, 1)
}
}
// Make normal timestamps from js dates
if (model.reminderDates.length > 0) {
model.reminderDates = model.reminderDates.map(r => {
return new Date(r).toISOString()
if (model.reminders.length > 0) {
model.reminders.forEach(r => {
r.reminder = new Date(r.reminder).toISOString()
})
}