This commit is contained in:
2019-03-04 19:03:04 +00:00
parent 168e51dacc
commit 175a442a3e
5 changed files with 60 additions and 89 deletions

View File

@@ -0,0 +1,44 @@
<script>
//////////////////////////////////////////
// GZTimePicker
// This component was created to wrap the
// vuetify time picker to allow using string date
// and time in iso format and not lose the date
// portion when picking a new time
//2019-02-12T10:12:39.594206
/* eslint-disable */
export default {
props: {
value: {
type: String,
default: ""
}
},
render() {
var that = this;
return this.$createElement("v-time-picker", {
props: {
...this.$attrs,
value: this.value ? this.value.substr(11,8) : null
},
on: {
...this.$listeners,
input: function(time) {
// debugger;
//Put back the time portion from before
var combined = that.value.substr(0, 9) + time;
that.$emit("input", new Date(combined).toISOString());
},
"click:minute": function(time) {
// debugger;
//Put back the time portion from before
var combined = that.value.substr(0, 9) + time;
that.$emit("input", new Date(combined).toISOString());
}
}
});
}
};
</script>