You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this is a test that i added to show the issue, if you try to run it it goes on an infinite loop,
i have found a fix to that:
function addUnit(unit) {
return function (n, d) {
if (!d.isWorkingTime()) {
d = d.nextWorkingTime();
}
var i = 0;
while (n > 0) {
var segment = openingTimes(d)[i];
if (!segment || d.isBefore(segment[0])) {
i = 0;
d = d.nextWorkingTime();
continue;
}
if (d.isAfter(segment[1])) {
i++;
continue;
}
var jump = segment[1].diff(d, unit);
if (jump > n) {
jump = n;
}
if (jump < 1) {
jump = 1;
}
var then = d.clone().add(jump, unit);
n -= jump;
if (then.isSameOrBefore(segment[1])) {
d = d.add(jump, unit);
} else {
var next = then.nextWorkingTime();
var diff = then.diff(segment[1], unit, true);
d = next.add(diff,unit);
}
}
return d;
};
}
the fix is right before the first "continue" statement, i would like to push the fix, but i am unable to do that
The text was updated successfully, but these errors were encountered:
Hi,
i have an issue with the following situation:
this is a test that i added to show the issue, if you try to run it it goes on an infinite loop,
i have found a fix to that:
the fix is right before the first "continue" statement, i would like to push the fix, but i am unable to do that
The text was updated successfully, but these errors were encountered: