diff --git a/ayanova/src/api/locale.js b/ayanova/src/api/locale.js index 0bf77fe0..f771d32d 100644 --- a/ayanova/src/api/locale.js +++ b/ayanova/src/api/locale.js @@ -233,6 +233,21 @@ export default { return ret; }, /////////////////////////////////////////////// + // UTC ISO 8601 string add minutes + // and return as UTC ISO 8601 string + // (used to set automatic / default adjusted times) + // + addMinutesToUTC8601String(val, minutes) { + if (!val || val == "" || minutes == null || minutes == 0) { + return val; + } + //instantiate a luxon date object from val which is assumed to be an iso string + let dt = window.$gz.DateTime.fromISO(val); + //add minutes + dt = dt.plus({ minutes: minutes }); + return dt.toUTC().toString(); + }, + /////////////////////////////////////////////// // Local now timestamp converted to timeZoneName // and output as ISO 8601 // (used to inform server of local client time) diff --git a/ayanova/src/components/work-order-item-scheduled-users.vue b/ayanova/src/components/work-order-item-scheduled-users.vue index 5121adf8..5e35a569 100644 --- a/ayanova/src/components/work-order-item-scheduled-users.vue +++ b/ayanova/src/components/work-order-item-scheduled-users.vue @@ -408,6 +408,10 @@ export default { this.activeItemIndex ].startDate; console.log("Start date value is now", val); + + let d = window.$gz.locale.addMinutesToUTC8601String(val, 60); + + console.log("start plus 60 minutes is:", d); }, handleStopDateChange: function() { let val = this.value.items[this.activeWoItemIndex].scheduledUsers[