From fe206f5c875d4aed126a43928a67e854e638577f Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 6 Feb 2020 23:44:11 +0000 Subject: [PATCH] --- ayanova/src/components/date-time-control.vue | 29 ++++---------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/ayanova/src/components/date-time-control.vue b/ayanova/src/components/date-time-control.vue index f9fd5839..b9a6275b 100644 --- a/ayanova/src/components/date-time-control.vue +++ b/ayanova/src/components/date-time-control.vue @@ -236,30 +236,13 @@ export default { }, set(value) { //https://moment.github.io/luxon/docs/manual/zones.html#creating-datetimes-in-a-zone - //var overrideZone = DateTime.fromISO("2017-05-15T09:10:23", { zone: "Europe/Paris" }); - //set this.date to utc iso string based on incoming value which is same format as set above - //so need to take the time portion, construct a date object - console.log("timeOnly:set value incoming is:"); - console.log(value); - console.log("this.value is:"); - console.log(this.value); - - console.log("Attempting parse from:"); - console.log(this.dateOnly + "T" + value); - - var overrideZone = window.$gz.DateTime.fromISO( - this.dateOnly + "T" + value, - { zone: this.timeZoneName } - ); - console.log("timeOnly:conversion to overrideZone:"); - console.log(overrideZone.toString()); - var utcZoned = overrideZone.setZone("utc"); - - console.log("output as utc iso string:"); - console.log(utcZoned.toISO()); - - //this.date=overrideZone.dt.toISO(); + //parse in the time in the currently used timezone + this.date = window.$gz.DateTime.fromISO(this.dateOnly + "T" + value, { + zone: this.timeZoneName + }) + .setZone("utc") //convert to UTC + .toISO(); //output as ISO 8601 } } }