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;
}
// 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

View File

@@ -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;
},

View File

@@ -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;
},