Commit 8d5ee7e4 authored by Glen Ditchfield's avatar Glen Ditchfield 🐛
Browse files

Remove all days of multi-day holidays from the workday list

BUG: 441738
parent 7e9a290d
Pipeline #79349 passed with stage
in 4 minutes and 32 seconds
......@@ -716,12 +716,11 @@ QList<QDate> CalendarSupport::workDays(QDate startDate, QDate endDate)
for (const QString &regionStr : holidays) {
KHolidays::HolidayRegion region(regionStr);
if (region.isValid()) {
const KHolidays::Holiday::List list = region.holidays(startDate, endDate);
const int listCount(list.count());
for (int i = 0; i < listCount; ++i) {
const KHolidays::Holiday &h = list.at(i);
for (auto const h : region.holidays(startDate, endDate)) {
if (h.dayType() == KHolidays::Holiday::NonWorkday) {
result.removeAll(h.observedStartDate());
for (int i = 0; i < h.duration(); i++) {
result.removeOne(h.observedStartDate().addDays(i));
}
}
}
}
......
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