1
0

Add moment.js for date related things (#50)

Fix saving

Use mixin everywhere

Format attachment dates

Add format date mixing

Use moment js on task list page

Use moment js on home page tasks

Add moment js

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/50
This commit is contained in:
konrad
2020-01-30 20:49:00 +00:00
parent da10b4310b
commit a0c4732f81
9 changed files with 30 additions and 8 deletions

View File

@ -82,4 +82,9 @@ export default class AttachmentService extends AbstractService {
cancel()
})
}
processModel(model) {
model.created = Math.round(+new Date(model.created) / 1000)
return model
}
}

View File

@ -1,5 +1,6 @@
import AbstractService from './abstractService'
import TaskModel from '../models/task'
import AttachmentService from './attachment'
export default class TaskService extends AbstractService {
constructor() {
@ -81,6 +82,14 @@ export default class TaskService extends AbstractService {
})
})
// Process all attachments to preven parsing errors
if(model.attachments.length > 0) {
const attachmentService = new AttachmentService()
model.attachments.map(a => {
return attachmentService.processModel(a)
})
}
return model
}
}