From de96eeac26636d3d5a57a9090a9a8d338c047a88 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Mon, 13 Jul 2020 23:30:17 +0000 Subject: [PATCH] --- ayanova/src/components/duration-control.vue | 52 ++++++++++++++++++- .../src/views/home-notify-subscription.vue | 3 +- 2 files changed, 51 insertions(+), 4 deletions(-) diff --git a/ayanova/src/components/duration-control.vue b/ayanova/src/components/duration-control.vue index 13799d95..0e8b0469 100644 --- a/ayanova/src/components/duration-control.vue +++ b/ayanova/src/components/duration-control.vue @@ -93,7 +93,34 @@ export default { }, watch: { value(val) { - this.internalValue = val; + //this.internalValue = val; + if (val == null) { + this.days = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + return; + } + let work = val.split(":"); + //has days? + if (work[0].includes(".")) { + let dh = work[0].split("."); + this.days = Number(dh[0]); + this.hours = Number(dh[1]); + } else { + this.days = 0; + this.hours = Number(work[0]); + } + + this.minutes = Number(work[1]); + + //has milliseconds? (ignore them) + if (work[2].includes(".")) { + let dh = work[2].split("."); + this.seconds = Number(dh[0]); + } else { + this.seconds = Number(work[2]); + } } }, props: { @@ -159,7 +186,28 @@ export default { } this.handleInput(); }, - handleInput() {} + handleInput() { + //{"data":{"testTSDaysWMS":"22.10:15:22.0330000","testTSHMS":"05:16:33","testTS_DHMS":"5.10:15:33","testTS_MS":"00:15:33","testTS_S":"00:00:33","testTS_D":"22.00:00:00"}} + // DD.HH:MM:SS.ms + let ret = ""; + let vm = this; + if (vm.days && vm.days > 0) { + ret = `${vm.days}.`; + } + + if (!vm.hours) { + vm.hours = 0; + } + if (!vm.minutes) { + vm.minutes = 0; + } + + if (!vm.seconds) { + vm.seconds = 0; + } + ret += `${vm.hours}:${vm.minutes}:${vm.seconds}`; + this.$emit("input", ret); + } //combine these into the proper timespan string // //combine the time and dates into a consolidated value // let TimePortion = window.$gz.locale.utcDateStringToLocal8601TimeOnlyString( diff --git a/ayanova/src/views/home-notify-subscription.vue b/ayanova/src/views/home-notify-subscription.vue index c512cac8..18e7b6d6 100644 --- a/ayanova/src/views/home-notify-subscription.vue +++ b/ayanova/src/views/home-notify-subscription.vue @@ -46,8 +46,7 @@ :readonly="formState.readOnly" :disabled="formState.readOnly" :label="$ay.t('NotifySubscriptionPendingSpan')" - :showSeconds="true" - :error="'This is an error message'" + :showSeconds="false" ref="advanceNotice" :data-cy="!!$ay.dev ? 'advanceNotice' : false" :error-messages="form().serverErrors(this, 'advanceNotice')"