cleaning task manager
This commit is contained in:
parent
6d72a7b967
commit
a7a745e04f
3 changed files with 8 additions and 5 deletions
|
@ -139,7 +139,6 @@ export default {
|
|||
|
||||
data.time.start = moment.unix(event.start_datetime).format('HH:mm')
|
||||
data.time.end = moment.unix(event.end_datetime).format('HH:mm')
|
||||
data.date = [moment.unix(event.start_datetime).toDate()]
|
||||
data.event.title = event.title
|
||||
data.event.description = event.description
|
||||
data.event.id = event.id
|
||||
|
|
|
@ -28,7 +28,7 @@ export default ({ app, store }) => {
|
|||
if (event.parent && where !== 'home') {
|
||||
const { frequency, days, type } = event.parent.recurrent
|
||||
if (frequency === '1w' || frequency === '2w') {
|
||||
const recurrent = app.i18n.tc(`event.recurrent_${frequency}_days`, days.length, { days: days.map(d => moment().day(d).format('dddd')) })
|
||||
const recurrent = app.i18n.tc(`event.recurrent_${frequency}_days`, days.length, { days: days.map(d => moment().day(d - 1).format('dddd')) })
|
||||
return `${normal} - ${recurrent}`
|
||||
} else if (frequency === '1m' || frequency === '2m') {
|
||||
const d = type === 'ordinal' ? days : days.map(d => moment().day(d - 1).format('dddd'))
|
||||
|
|
|
@ -67,10 +67,14 @@ class TaskManager {
|
|||
if (!this.tasks.length) {
|
||||
return
|
||||
}
|
||||
const removableTasks = this.tasks.filter(t => t.removable).map(t => t.process())
|
||||
this.tasks = this.tasks.filter(t => !t.removable)
|
||||
|
||||
// process all tasks
|
||||
const tasks = this.tasks.map(t => t.process())
|
||||
return Promise.all(tasks.concat(removableTasks))
|
||||
|
||||
// remove removable tasks
|
||||
this.tasks = this.tasks.filter(t => !t.removable)
|
||||
|
||||
return Promise.all(tasks)
|
||||
}
|
||||
|
||||
async tick () {
|
||||
|
|
Loading…
Reference in a new issue