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"', ':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()