Use the new datepicker for start date
All checks were successful
continuous-integration/drone/pr Build is passing

This commit is contained in:
kolaente 2020-11-28 13:40:54 +01:00
parent 390afe1f81
commit 972eb5acfc
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 12 additions and 16 deletions

View File

@ -134,7 +134,7 @@ export default {
}, },
props: { props: {
value: { value: {
validator: prop => prop instanceof Date || prop === null validator: prop => prop instanceof Date || prop === null || typeof prop === 'string'
}, },
chooseDateLabel: { chooseDateLabel: {
type: String, type: String,
@ -150,7 +150,7 @@ export default {
}, },
watch: { watch: {
value(newVal) { value(newVal) {
this.date = newVal this.date = new Date(newVal)
}, },
flatPickrDate(newVal) { flatPickrDate(newVal) {
this.date = new Date(newVal) this.date = new Date(newVal)

View File

@ -80,18 +80,14 @@
Start Date Start Date
</div> </div>
<div class="date-input"> <div class="date-input">
<flat-pickr <datepicker
:class="{ 'disabled': taskService.loading}"
:config="flatPickerConfig"
:disabled="taskService.loading || !canWrite"
@on-close="() => saveTask()"
class="input"
placeholder="Click here to set a start date"
ref="startDate"
v-model="task.startDate" v-model="task.startDate"
> @close="() => saveTask()"
</flat-pickr> choose-date-label="Click here to set a start date"
<a @click="() => {task.startDate = null;saveTask()}" v-if="task.startDate && canWrite"> :disabled="taskService.loading || !canWrite"
ref="startDate"
/>
<a @click="() => {task.startDate = null;saveTask()}" v-if="task.startDate && canWrite" class="remove">
<span class="icon is-small"> <span class="icon is-small">
<icon icon="times"></icon> <icon icon="times"></icon>
</span> </span>