Commit 793985e4 authored by GoshaZotov's avatar GoshaZotov

fix bug 36064

parent 5732a787
...@@ -1828,6 +1828,15 @@ ...@@ -1828,6 +1828,15 @@
var calcDate = function () { var calcDate = function () {
var dif = arg1.getValue(), count = 1, dif1 = dif > 0 ? 1 : dif < 0 ? -1 : 0, val, date = val0; var dif = arg1.getValue(), count = 1, dif1 = dif > 0 ? 1 : dif < 0 ? -1 : 0, val, date = val0;
if (1 === dif) {
//если данный день выходной
//если далее выходные
date = new Date(val0.getTime() + dif1 * c_msPerDay);
while(date.getUTCDay() === 6 || date.getUTCDay() === 0 || !_includeInHolidays(date, holidays)){
dif >= 0 ? dif1++ : dif1--;
date = new Date(val0.getTime() + dif1 * c_msPerDay);
}
}else{
while (Math.abs(dif) > count) { while (Math.abs(dif) > count) {
date = new Date(val0.getTime() + dif1 * c_msPerDay); date = new Date(val0.getTime() + dif1 * c_msPerDay);
if (date.getUTCDay() !== 6 && date.getUTCDay() !== 0 && _includeInHolidays(date, holidays)) { if (date.getUTCDay() !== 6 && date.getUTCDay() !== 0 && _includeInHolidays(date, holidays)) {
...@@ -1844,6 +1853,7 @@ ...@@ -1844,6 +1853,7 @@
} }
} }
} }
}
date = new Date(val0.getTime() + dif1 * c_msPerDay); date = new Date(val0.getTime() + dif1 * c_msPerDay);
val = date.getExcelDate(); val = date.getExcelDate();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment