Add support for Buefy datepicker in grid filters

This commit is contained in:
Lance Edgar 2019-05-21 13:44:02 -05:00
parent 0f0b32d797
commit d5d04b7dac
5 changed files with 26 additions and 4 deletions

View file

@ -11,7 +11,8 @@ const TailboneDatepicker = {
'icon="calendar-alt"',
':date-formatter="formatDate"',
':date-parser="parseDate"',
':value="rawValue ? parseDate(rawValue) : null"',
':value="value ? parseDate(value) : null"',
'@input="dateChanged"',
'>',
'</b-datepicker>'
].join(' '),
@ -19,7 +20,7 @@ const TailboneDatepicker = {
props: {
name: String,
id: String,
rawValue: String
value: String
},
methods: {
@ -39,6 +40,11 @@ const TailboneDatepicker = {
// note, this assumes classic YYYY-MM-DD (i.e. ISO?) format
var parts = date.split('-')
return new Date(parts[0], parseInt(parts[1]) - 1, parts[2])
},
dateChanged(date) {
this.value = this.formatDate(date)
this.$emit('input', this.value)
}
}