This commit is contained in:
44
ayanova/src/components/gztimepicker.vue
Normal file
44
ayanova/src/components/gztimepicker.vue
Normal 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>
|
||||
Reference in New Issue
Block a user