monthly budget, monthly report, unified report calculation (#2684)

This commit is contained in:
Kevin Papst
2021-08-06 18:38:41 +02:00
committed by GitHub
parent 21f785638c
commit cefd747e91
196 changed files with 5031 additions and 2167 deletions

View File

@@ -276,12 +276,20 @@
duration = parseFloat(duration) * 3600;
momentDuration = moment.duration('PT' + duration + 'S');
} else if (duration.indexOf('H') !== -1 || duration.indexOf('M') !== -1 || duration.indexOf('S') !== -1) {
{# D for days does not work, because 'PT1H' but with days 'P1D' is used #}
momentDuration = moment.duration('PT' + duration);
} else {
let c = parseInt(duration);
let d = parseInt(duration).toFixed();
if (!isNaN(c) && duration === d) {
duration = c * 3600;
momentDuration = moment.duration('PT' + duration + 'S');
}
}
return momentDuration;
}
function applyDateToField(field, momentObj, format)
{
field.value = momentObj.format(format);