<script>
//////////////////////////////////////////
//  GZDatePicker
// This component was created to wrap the
// vuetify date picker to allow using string date
// and time in iso format and not lose the time
// portion when picking a new date
//
/*  Xeslint-disable */
export default {
  props: {
    value: {
      type: String,
      default: ""
    }
  },
  render() {
    var that = this;
    return this.$createElement("v-date-picker", {
      props: {
        ...this.$attrs,
        value: this.value ? this.value.substr(0, 10) : null
      },
      on: {
        ...this.$listeners,
        input: function(date) {
          //debugger;
          //Put back the time portion from before
          var combined = date + that.value.substr(10);
          that.$emit("input", new Date(combined).toISOString());
          //Note: I have observed that it converts a date with milliseconds to a date with the final 3 digits stripped and Z put in instead
          //Not sure if this will be an issue or not but if it is then might need to force to not UTC or whatever
        }
      }
    });
  }
};
</script>
