diff --git a/ayanova/src/api/locale.js b/ayanova/src/api/locale.js index 333bbe41..88c9da81 100644 --- a/ayanova/src/api/locale.js +++ b/ayanova/src/api/locale.js @@ -431,6 +431,20 @@ export default { }); return 0; } + + // console.log( + // "locale:diffhours...", + // stopDate.diff(startDate, "hours").toObject().hours + // ); + + // console.log( + // "locale:diffhours.. ROUNDED.", + // window.$gz.util.roundAccurately( + // stopDate.diff(startDate, "hours").toObject().hours, + // 2 + // ) + // ); + return window.$gz.util.roundAccurately( stopDate.diff(startDate, "hours").toObject().hours, 2 diff --git a/ayanova/src/components/date-time-control.vue b/ayanova/src/components/date-time-control.vue index c1c5ee45..4d8851ec 100644 --- a/ayanova/src/components/date-time-control.vue +++ b/ayanova/src/components/date-time-control.vue @@ -158,31 +158,26 @@ export default { }, methods: { setToday() { - var tmp = window.$gz.DateTime.local() - .setZone(this.timeZoneName) - .toUTC() - .toString(); - console.log(tmp); + //Was this but in afternoon shows the next day ?!? + // const v = window.$gz.locale + // .nowUTC8601String(this.timeZoneName) + // .split("T")[0]; - // console.log("setToday", { - // tz: this.timeZoneName, - // now: window.$gz.locale.nowUTC8601String(this.timeZoneName) - // }); - const v = window.$gz.locale - .nowUTC8601String(this.timeZoneName) + const v = window.$gz.DateTime.local() + .toString() .split("T")[0]; - //console.log("end result:", v); this.updateDateValue(v); this.dlgdate = false; }, setNow() { - // console.log("setNow", { - // tz: this.timeZoneName, - // now: window.$gz.locale.nowUTC8601String(this.timeZoneName) - // }); - const v = window.$gz.locale.nowUTC8601String().split("T")[1]; - //console.log("end result:", v); + //was this but works the more simpler way copied from set today + //const v = window.$gz.locale.nowUTC8601String().split("T")[1]; + + //now without the milliseconds + var nowNoMs = window.$gz.DateTime.local().set({ milliseconds: 0 }); + const v = nowNoMs.toString().split("T")[1]; + this.updateTimeValue(v); this.dlgtime = false; }, diff --git a/ayanova/src/components/time-control.vue b/ayanova/src/components/time-control.vue index 81ed4394..568167c3 100644 --- a/ayanova/src/components/time-control.vue +++ b/ayanova/src/components/time-control.vue @@ -108,9 +108,14 @@ export default { }, methods: { setNow() { - const v = window.$gz.locale - .nowUTC8601String(this.timeZoneName) - .split("T")[1]; + // const v = window.$gz.locale + // .nowUTC8601String(this.timeZoneName) + // .split("T")[1]; + + //now without the milliseconds + var nowNoMs = window.$gz.DateTime.local().set({ milliseconds: 0 }); + const v = nowNoMs.toString().split("T")[1]; + this.updateTimeValue(v); this.dlgtime = false; },