This commit is contained in:
2022-02-22 23:31:27 +00:00
parent 904dc5259f
commit e77c8283f5
5 changed files with 97 additions and 63 deletions

View File

@@ -14,10 +14,10 @@ export default {
// type: "GzDashTestListWidgetsPriciest"
// },
{
id: "TestScheduleableOnly",
id: "NextSchedItems",
roles: [role.Tech, role.TechRestricted],
title: "TEST sched user widget",
type: "NextSchedItem",
type: "NextSchedItems",
scheduleableUserOnly: true
},
{

View File

@@ -408,6 +408,29 @@ export default {
return dt.toUTC().toString();
},
///////////////////////////////////////////////
// UTC ISO 8601 string add arbitrary value based
// on luxon duration format
// and return as UTC ISO 8601 string
//https://moment.github.io/luxon/api-docs/index.html#datetimeplus
//
addDurationToUTC8601String(val, duration) {
if (!val || val == "" || duration == null || !this.isObject(duration)) {
return val;
}
//instantiate a luxon date object from val which is assumed to be an iso string
let dt = window.$gz.DateTime.fromISO(val);
if (!dt.isValid) {
console.error("locale::addDurationToUTC8601String, input not valid:", {
val: val,
dt: dt
});
return val;
}
//add minutes
dt = dt.plus(duration);
return dt.toUTC().toString();
},
///////////////////////////////////////////////
// parse UTC ISO 8601 strings, diff, return hours
//
diffHoursFromUTC8601String(start, stop) {