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:
@ -82,4 +82,9 @@ export default class AttachmentService extends AbstractService {
|
||||
cancel()
|
||||
})
|
||||
}
|
||||
|
||||
processModel(model) {
|
||||
model.created = Math.round(+new Date(model.created) / 1000)
|
||||
return model
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user