Skip to content

Commit

Permalink
Allow clearing of date values. Enable button bar.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrichar1 committed Sep 6, 2023
1 parent 8d572c3 commit 4a5191c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
9 changes: 5 additions & 4 deletions src/components/fields/DateInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down Expand Up @@ -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 }
Expand All @@ -77,10 +81,7 @@ export default {
return date
},
set(newDate) {
// Ignore falsey values
if (newDate) {
this.fieldValue = newDate
}
this.fieldValue = newDate
},
},
},
Expand Down

0 comments on commit 4a5191c

Please sign in to comment.