[FIX]major bug fixes

This commit is contained in:
Horilla
2023-08-01 16:48:48 +05:30
parent 243803b5c4
commit eed40dd4b8
20 changed files with 2500 additions and 1223 deletions

View File

@@ -87,9 +87,9 @@ def company_leave_dates_list(company_leaves,start_date):
calendar.setfirstweekday(0)
month_calendar = calendar.monthcalendar(year, month)
for week in month_calendar:
if week[int(based_on_week_day)] != 0:
if week[int(based_on_week_day)-1] != 0:
date = datetime.strptime(
f"{year}-{month:02}-{week[int(based_on_week_day)]:02}", '%Y-%m-%d').date()
f"{year}-{month:02}-{week[int(based_on_week_day)-1]:02}", '%Y-%m-%d').date()
if date not in company_leave_dates:
company_leave_dates.append(date)
return company_leave_dates