Add 'disabled' prop for buefy datepicker
also make sure we return `null` when input is empty
This commit is contained in:
parent
ad3b660bc0
commit
f1b6f8a3e4
|
@ -13,6 +13,7 @@ const TailboneDatepicker = {
|
||||||
':date-parser="parseDate"',
|
':date-parser="parseDate"',
|
||||||
':value="value ? parseDate(value) : null"',
|
':value="value ? parseDate(value) : null"',
|
||||||
'@input="dateChanged"',
|
'@input="dateChanged"',
|
||||||
|
':disabled="disabled"',
|
||||||
'>',
|
'>',
|
||||||
'</b-datepicker>'
|
'</b-datepicker>'
|
||||||
].join(' '),
|
].join(' '),
|
||||||
|
@ -20,12 +21,16 @@ const TailboneDatepicker = {
|
||||||
props: {
|
props: {
|
||||||
name: String,
|
name: String,
|
||||||
id: String,
|
id: String,
|
||||||
value: String
|
value: String,
|
||||||
|
disabled: Boolean,
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
formatDate(date) {
|
formatDate(date) {
|
||||||
|
if (date === null) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
// just need to convert to simple ISO date format here, seems
|
// just need to convert to simple ISO date format here, seems
|
||||||
// like there should be a more obvious way to do that?
|
// like there should be a more obvious way to do that?
|
||||||
var year = date.getFullYear()
|
var year = date.getFullYear()
|
||||||
|
|
Loading…
Reference in a new issue