cleaning task manager
This commit is contained in:
@@ -139,7 +139,6 @@ export default {
|
|||||||
|
|
||||||
data.time.start = moment.unix(event.start_datetime).format('HH:mm')
|
data.time.start = moment.unix(event.start_datetime).format('HH:mm')
|
||||||
data.time.end = moment.unix(event.end_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.title = event.title
|
||||||
data.event.description = event.description
|
data.event.description = event.description
|
||||||
data.event.id = event.id
|
data.event.id = event.id
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export default ({ app, store }) => {
|
|||||||
if (event.parent && where !== 'home') {
|
if (event.parent && where !== 'home') {
|
||||||
const { frequency, days, type } = event.parent.recurrent
|
const { frequency, days, type } = event.parent.recurrent
|
||||||
if (frequency === '1w' || frequency === '2w') {
|
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}`
|
return `${normal} - ${recurrent}`
|
||||||
} else if (frequency === '1m' || frequency === '2m') {
|
} else if (frequency === '1m' || frequency === '2m') {
|
||||||
const d = type === 'ordinal' ? days : days.map(d => moment().day(d - 1).format('dddd'))
|
const d = type === 'ordinal' ? days : days.map(d => moment().day(d - 1).format('dddd'))
|
||||||
|
|||||||
@@ -67,10 +67,14 @@ class TaskManager {
|
|||||||
if (!this.tasks.length) {
|
if (!this.tasks.length) {
|
||||||
return
|
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())
|
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 () {
|
async tick () {
|
||||||
|
|||||||
Reference in New Issue
Block a user