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

View File

@@ -52,7 +52,7 @@
</div> </div>
</template> </template>
<script> <script>
/* Xeslint-disable */ /* eslint-disable */
export default { export default {
beforeCreate() { beforeCreate() {
//check pre-requisites exist just in case //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: { props: {
label: String, label: String,
rules: Array, rules: Array,
@@ -78,8 +78,16 @@ export default {
}, },
watch: { watch: {
date() { date() {
this.$emit("input", 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
this.$emit("change", this.date); //always in UTC 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() { value() {
this.date = this.value; //always in UTC this.date = this.value; //always in UTC