Update edit user form to use base-form and update date-selector to emit changes

This commit is contained in:
leigh-mil
2019-04-02 15:04:17 -04:00
parent 7fca19ebee
commit ade3f38b5e
2 changed files with 48 additions and 33 deletions

View File

@@ -62,18 +62,23 @@ export default {
isMonthValid: function() {
var _month = parseInt(this.month)
return _month >= 0 && _month <= 12
var valid = _month >= 0 && _month <= 12
this._emitChange('month', this.month, valid)
return valid
},
isDayValid: function() {
var _day = parseInt(this.day)
return _day >= 0 && _day <= this.daysMaxCalculation
var valid = _day >= 0 && _day <= this.daysMaxCalculation
this._emitChange('day', this.day, valid)
return valid
},
isYearValid: function() {
return parseInt(this.year) >= 1
// Emit a change event
var valid = parseInt(this.year) >= 1
this._emitChange('year', this.year, valid)
return valid
},
isWithinDateRange: function() {
@@ -128,6 +133,12 @@ export default {
},
},
methods: {
_emitChange: function(name, value, valid) {
this.$root.$emit('field-change', { value, valid, name })
},
},
render: function(createElement) {
return createElement('p', 'Please implement inline-template')
},