Browse Source

automatically create multiple tasks if seperated by semicolons;

chronos
stingl 3 years ago
parent
commit
0f08919318
  1. 24
      src/views/TasksForTracker.vue

24
src/views/TasksForTracker.vue

@ -83,13 +83,23 @@ export default {
this.$store.state.selectedTracker.tasks = []; this.$store.state.selectedTracker.tasks = [];
} }
this.$store.state.selectedTracker.tasks.pushToBeginning({ let newTasks = [this.newTaskInput];
name: this.newTaskInput,
done: false, if (this.newTaskInput.split(';') > 3) {
created: moment(), newTasks = this.newTaskInput.split(';').reverse().map((task) => {
percentDone: 0, return task.trim();
finished: null })
}); }
newTasks.forEach((task) => {
this.$store.state.selectedTracker.tasks.pushToBeginning({
name: task,
done: false,
created: moment(),
percentDone: 0,
finished: null
});
})
this.newTaskInput = ''; this.newTaskInput = '';
this.$store.commit('saveTrackers'); this.$store.commit('saveTrackers');

Loading…
Cancel
Save