This commit is contained in:
2022-02-04 01:08:48 +00:00
parent afab91a2e1
commit 721fab0b07
3 changed files with 35 additions and 21 deletions

View File

@@ -431,6 +431,20 @@ export default {
}); });
return 0; 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( return window.$gz.util.roundAccurately(
stopDate.diff(startDate, "hours").toObject().hours, stopDate.diff(startDate, "hours").toObject().hours,
2 2

View File

@@ -158,31 +158,26 @@ export default {
}, },
methods: { methods: {
setToday() { setToday() {
var tmp = window.$gz.DateTime.local() //Was this but in afternoon shows the next day ?!?
.setZone(this.timeZoneName) // const v = window.$gz.locale
.toUTC() // .nowUTC8601String(this.timeZoneName)
.toString(); // .split("T")[0];
console.log(tmp);
// console.log("setToday", { const v = window.$gz.DateTime.local()
// tz: this.timeZoneName, .toString()
// now: window.$gz.locale.nowUTC8601String(this.timeZoneName)
// });
const v = window.$gz.locale
.nowUTC8601String(this.timeZoneName)
.split("T")[0]; .split("T")[0];
//console.log("end result:", v);
this.updateDateValue(v); this.updateDateValue(v);
this.dlgdate = false; this.dlgdate = false;
}, },
setNow() { setNow() {
// console.log("setNow", { //was this but works the more simpler way copied from set today
// tz: this.timeZoneName, //const v = window.$gz.locale.nowUTC8601String().split("T")[1];
// now: window.$gz.locale.nowUTC8601String(this.timeZoneName)
// }); //now without the milliseconds
const v = window.$gz.locale.nowUTC8601String().split("T")[1]; var nowNoMs = window.$gz.DateTime.local().set({ milliseconds: 0 });
//console.log("end result:", v); const v = nowNoMs.toString().split("T")[1];
this.updateTimeValue(v); this.updateTimeValue(v);
this.dlgtime = false; this.dlgtime = false;
}, },

View File

@@ -108,9 +108,14 @@ export default {
}, },
methods: { methods: {
setNow() { setNow() {
const v = window.$gz.locale // const v = window.$gz.locale
.nowUTC8601String(this.timeZoneName) // .nowUTC8601String(this.timeZoneName)
.split("T")[1]; // .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.updateTimeValue(v);
this.dlgtime = false; this.dlgtime = false;
}, },