Task duration (#13)
This commit is contained in:
parent
4e324ac38a
commit
de6104dda6
2 changed files with 48 additions and 12 deletions
|
@ -107,6 +107,34 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label class="label" for="">Duration</label>
|
||||
<div class="control columns">
|
||||
<div class="column">
|
||||
<flat-pickr
|
||||
:class="{ 'disabled': loading}"
|
||||
class="input"
|
||||
:disabled="loading"
|
||||
v-model="taskEditTask.startDate"
|
||||
:config="flatPickerConfig"
|
||||
id="taskduedate"
|
||||
placeholder="Start date">
|
||||
</flat-pickr>
|
||||
</div>
|
||||
<div class="column">
|
||||
<flat-pickr
|
||||
:class="{ 'disabled': loading}"
|
||||
class="input"
|
||||
:disabled="loading"
|
||||
v-model="taskEditTask.endDate"
|
||||
:config="flatPickerConfig"
|
||||
id="taskduedate"
|
||||
placeholder="Start date">
|
||||
</flat-pickr>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label class="label" for="">Repeat after</label>
|
||||
<div class="control repeat-after-input columns">
|
||||
|
@ -339,8 +367,10 @@
|
|||
const cancel = message.setLoading(this)
|
||||
|
||||
// Convert the date in a unix timestamp
|
||||
let duedate = (+ new Date(this.taskEditTask.dueDate)) / 1000
|
||||
this.taskEditTask.dueDate = duedate
|
||||
this.taskEditTask.dueDate = (+ new Date(this.taskEditTask.dueDate)) / 1000
|
||||
this.taskEditTask.startDate = (+ new Date(this.taskEditTask.startDate)) / 1000
|
||||
this.taskEditTask.endDate = (+ new Date(this.taskEditTask.endDate)) / 1000
|
||||
|
||||
|
||||
// remove all nulls
|
||||
this.taskEditTask.reminderDates = this.removeNullsFromArray(this.taskEditTask.reminderDates)
|
||||
|
@ -381,7 +411,7 @@
|
|||
this.updateTaskByID(this.taskEditTask.id, response.data)
|
||||
|
||||
// Also update the current taskedit object so the ui changes
|
||||
this.$set(this, 'taskEditTask', response.data)
|
||||
this.$set(this, 'taskEditTask', this.fixStuffComingFromAPI(response.data))
|
||||
this.handleSuccess({message: 'The task was successfully updated.'})
|
||||
cancel() // cancel the timers
|
||||
})
|
||||
|
@ -413,16 +443,13 @@
|
|||
},
|
||||
fixStuffComingFromAPI(task) {
|
||||
// Make date objects from timestamps
|
||||
let dueDate = new Date(task.dueDate * 1000)
|
||||
if (dueDate === 0) {
|
||||
task.dueDate = null
|
||||
} else {
|
||||
task.dueDate = dueDate
|
||||
}
|
||||
task.dueDate = this.parseDateIfNessecary(task.dueDate)
|
||||
task.startDate = this.parseDateIfNessecary(task.startDate)
|
||||
task.endDate = this.parseDateIfNessecary(task.endDate)
|
||||
|
||||
for (const rd in task.reminderDates) {
|
||||
task.reminderDates[rd] = new Date(task.reminderDates[rd] * 1000)
|
||||
}
|
||||
task.reminderDates[rd] = this.parseDateIfNessecary(task.reminderDates[rd])
|
||||
}
|
||||
|
||||
// Make subtasks into empty array if null
|
||||
if (task.subtasks === null) {
|
||||
|
@ -430,6 +457,15 @@
|
|||
}
|
||||
return task
|
||||
},
|
||||
parseDateIfNessecary(dateUnix) {
|
||||
let dateobj = (+new Date(dateUnix * 1000))
|
||||
if (dateobj === 0 || dateUnix === 0) {
|
||||
dateUnix = null
|
||||
} else {
|
||||
dateUnix = dateobj
|
||||
}
|
||||
return dateUnix
|
||||
},
|
||||
updateLastReminderDate(selectedDates) {
|
||||
this.lastReminder = +new Date(selectedDates[0])
|
||||
},
|
||||
|
|
2
todo.md
2
todo.md
|
@ -85,6 +85,7 @@
|
|||
* [ ] Teams with access to a list
|
||||
* [ ] Teams with access to a namespace
|
||||
* [x] Subtasks
|
||||
* [x] Start/Enddatum für Tasks
|
||||
* [ ] Priorities
|
||||
* [ ] Sachen mit hoher Prio irgendwie hervorheben (rotes Dreieck zb)
|
||||
* [ ] Listen Kopieren
|
||||
|
@ -95,7 +96,6 @@
|
|||
* [ ] Assignees
|
||||
* [ ] Timeline/Calendar view
|
||||
* [ ] In und Out webhooks, mit Templates vom Payload
|
||||
* [ ] Start/Enddatum für Tasks
|
||||
* [ ] Timeline/Calendar view -> Dazu tasks die in einem Bestimmten Bereich due sind, macht dann das Frontend
|
||||
* [ ] "Smart Lists", Listen nach bestimmten Kriterien gefiltert -> nur UI?
|
||||
* [ ] "Performance-Statistik" -> Wie viele Tasks man in bestimmten Zeiträumen so geschafft hat etc
|
||||
|
|
Loading…
Reference in a new issue