This commit is contained in:
2021-06-09 00:00:57 +00:00
parent 64e4d63faa
commit fd64cb9b94
3 changed files with 42 additions and 4 deletions

View File

@@ -174,6 +174,38 @@ export default {
hour12: hour12
});
},
///////////////////////////////////////////
// Turn a duration value into a display
//
durationLocalized(value) {
let theDays = 0;
let theHours = 0;
let theMinutes = 0;
let theSeconds = 0;
if (value == null) {
return "";
} else {
let work = vm.value.split(":");
//has days?
if (work[0].includes(".")) {
let dh = work[0].split(".");
theDays = Number(dh[0]);
theHours = Number(dh[1]);
} else {
theHours = Number(work[0]);
}
theMinutes = Number(work[1]);
//has milliseconds? (ignore them)
if (work[2].includes(".")) {
let dh = work[2].split(".");
theSeconds = Number(dh[0]);
} else {
theSeconds = Number(work[2]);
}
}
todo: finish this then move on to the UI part and jam this in
},
///////////////////////////////////////////////
// Convert a utc date to local time zone
// and return time portion only in iso 8601