From 4a5191c0d0470e6e62a33c2731700624e5915785 Mon Sep 17 00:00:00 2001 From: Matthew Richardson Date: Wed, 6 Sep 2023 10:29:59 +0100 Subject: [PATCH] Allow clearing of date values. Enable button bar. --- package.json | 2 +- src/components/fields/DateInput.vue | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 2cccc18..942444d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@uoe-eng/tabularasa", - "version": "1.26.8", + "version": "1.26.9", "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build --target lib --name tabularasa src/index.js", diff --git a/src/components/fields/DateInput.vue b/src/components/fields/DateInput.vue index 11f518b..33f5227 100644 --- a/src/components/fields/DateInput.vue +++ b/src/components/fields/DateInput.vue @@ -8,6 +8,7 @@ :id="'input' + fieldValue" v-model="date" date-format="yy-mm-dd" + :show-button-bar="true" v-bind="properties" :class="{ 'p-invalid': errorMessage }" @update:model-value="onUpdate($event)" @@ -61,6 +62,9 @@ export default { } // Send event as ISO8601 string,removing time part emit('update', event.toISOString()) + } else { + // Date value cleared + emit('update', event) } } return { errorMessage, fieldValue, onUpdate } @@ -77,10 +81,7 @@ export default { return date }, set(newDate) { - // Ignore falsey values - if (newDate) { - this.fieldValue = newDate - } + this.fieldValue = newDate }, }, },