From e9e2a94a4ca9089e4d6c87747009df6294400b8e Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 14 Jul 2020 13:49:10 +0000 Subject: [PATCH] --- ayanova/src/components/date-time-control.vue | 62 ++++++++++---------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/ayanova/src/components/date-time-control.vue b/ayanova/src/components/date-time-control.vue index b242eb25..62dd1af0 100644 --- a/ayanova/src/components/date-time-control.vue +++ b/ayanova/src/components/date-time-control.vue @@ -96,18 +96,35 @@ export default { updateValue() { let vm = this; - let dateValue = vm.$refs.dateField.$refs.input.value; - console.log( - "date-time-control::updateValue var datevalue is:", - dateValue - ); - // let DatePortion = window.$gz.locale.utcDateStringToLocal8601DateOnlyString( - // dateValue, - // vm.timeZoneName - // ); - let DatePortion = dateValue; + // let dateValue = vm.$refs.dateField.$refs.input.value; + // let DatePortion = dateValue; + // if (!DatePortion) { + // let v = new Date(); + // let fullYear = v.getFullYear(); + // let fullMonth = v.getMonth() + 1; + // if (fullMonth < 10) { + // fullMonth = "0" + fullMonth.toString(); + // } + // let fullDay = v.getDate(); + // if (fullDay < 10) { + // fullDay = "0" + fullDay.toString(); + // } + // DatePortion = fullYear + "-" + fullMonth + "-" + fullDay; + // } - if (!DatePortion) { + // let timeValue = vm.$refs.timeField.$refs.input.value; + // let TimePortion = timeValue; + // if (!TimePortion) { + // TimePortion = "00:00:00"; + // } + + // let ret = window.$gz.locale.localTimeDateStringToUTC8601String( + // DatePortion + "T" + TimePortion, + // this.timeZoneName + // ); + + let dateValue = vm.$refs.dateField.$refs.input.value; + if (!dateValue) { let v = new Date(); let fullYear = v.getFullYear(); let fullMonth = v.getMonth() + 1; @@ -118,33 +135,18 @@ export default { if (fullDay < 10) { fullDay = "0" + fullDay.toString(); } - DatePortion = fullYear + "-" + fullMonth + "-" + fullDay; + dateValue = fullYear + "-" + fullMonth + "-" + fullDay; } let timeValue = vm.$refs.timeField.$refs.input.value; - console.log( - "date-time-control::updateValue var timevalue is:", - timeValue - ); - // let TimePortion = window.$gz.locale.utcDateStringToLocal8601TimeOnlyString( - // timeValue, - // vm.timeZoneName - // ); - let TimePortion = timeValue; - if (!TimePortion) { - TimePortion = "00:00:00"; + if (!timeValue) { + timeValue = "00:00:00"; } - // console.log( - // "date-time-control::updateValue var timeportion is:", - // TimePortion - // ); - let ret = window.$gz.locale.localTimeDateStringToUTC8601String( - DatePortion + "T" + TimePortion, + dateValue + "T" + timeValue, this.timeZoneName ); - console.log("date-time-control::updateValue emitting:", ret); this.$emit("input", ret); } }