it works. now i have the code with help from you two buddies. thanks for your patience.
i paste it here, because so i can probalbly help other people.
function returnfinaldate() {
var varHolidays = [
new Date(2019, 03, 19), // good friday
new Date(2019, 03, 22), // easter monday
new Date(2019, 04, 30), // ascension day
new Date(2019, 05, 10), // whit monday
new Date(2020, 03, 10), // good friday
new Date(2020, 03, 13), // easter monday
new Date(2020, 04, 21), // ascension day
new Date(2020, 05, 01) // whit monday
];
// define fix holidays here, you don't need to change the year
var fixHolidays = [
new Date(2019, 00, 01),
new Date(2019, 02, 08), // womens day in Berlin
new Date(2019, 04, 01),
new Date(2019, 09, 03),
new Date(2019, 11, 24),
new Date(2019, 11, 25),
new Date(2019, 11, 26),
new Date(2019, 11, 31)
];
var startDate = util.scand("dd/mm/yyyy", this.getField('EingangC2').value);
var endDate = util.scand("dd/mm/yyyy", new Date());
var noOfDaysToAdd = this.getField('ATbisFertig').value;
var count = 0;
endDate = startDate;
while (count < noOfDaysToAdd) {
endDate.setDate(endDate.getDate() + 1);
if (endDate.getDay() == 0 || endDate.getDay() == 6) {
count--;
}
var isHoliday = false
// check variable holidays
for (i=0; i<varHolidays.length; i++) {
if ( (endDate.getDate() == varHolidays.getDate())
&& (endDate.getMonth() == varHolidays.getMonth())
&& (endDate.getFullYear() == varHolidays.getFullYear()))
{
isHoliday = true;
break;
}
}
// check fix holidays
for (i=0; i<fixHolidays.length; i++) {
if ((endDate.getDate() == fixHolidays.getDate()) && (endDate.getMonth() == fixHolidays.getMonth())) {
isHoliday = true;
break;
}
}
if (isHoliday) {
continue;
}
count++;
}
return endDate;
}
event.value = util.printd("dd.mm.yyyy", returnfinaldate());