Add 'disabled' prop for buefy datepicker

also make sure we return `null` when input is empty
This commit is contained in:
Lance Edgar 2019-07-23 13:12:07 -05:00
parent ad3b660bc0
commit f1b6f8a3e4

View file

@ -13,6 +13,7 @@ const TailboneDatepicker = {
':date-parser="parseDate"',
':value="value ? parseDate(value) : null"',
'@input="dateChanged"',
':disabled="disabled"',
'>',
'</b-datepicker>'
].join(' '),
@ -20,12 +21,16 @@ const TailboneDatepicker = {
props: {
name: String,
id: String,
value: String
value: String,
disabled: Boolean,
},
methods: {
formatDate(date) {
if (date === null) {
return null
}
// just need to convert to simple ISO date format here, seems
// like there should be a more obvious way to do that?
var year = date.getFullYear()