This commit is contained in:
2019-04-03 22:19:50 +00:00
parent b16f8d1a66
commit c723f50abf

View File

@@ -52,7 +52,7 @@
</div>
</template>
<script>
/* Xeslint-disable */
/* eslint-disable */
export default {
beforeCreate() {
//check pre-requisites exist just in case
@@ -65,7 +65,7 @@ export default {
}
}
},
data: () => ({ date: null, dlgdate: false, dlgtime: false }),
data: () => ({ date: null, oldDate: null, dlgdate: false, dlgtime: false }),
props: {
label: String,
rules: Array,
@@ -78,8 +78,16 @@ export default {
},
watch: {
date() {
this.$emit("input", this.date); //always in UTC
this.$emit("change", this.date); //always in UTC
//this tortuous fuckery is required so that the input and change events only fire on a real change, not setup
var hasChanged = false;
if (this.oldDate != null && this.date != this.oldDate) {
hasChanged = true;
}
this.oldDate = this.date;
if (hasChanged) {
this.$emit("input", this.date); //always in UTC
this.$emit("change", this.date); //always in UTC
}
},
value() {
this.date = this.value; //always in UTC