Start_date=datetime.datetime(start_year,start_month,start_day)Įnd_date=datetime.datetime(end_year,end_month,end_day)įor year in range(start_year,end_year+1):ĭate_ranges.append((start_date,datetime.datetime(start_date.year,12,31)))ĭate_ranges.append((datetime.datetime(start_year+1,1,1),end_date))ĭate_ranges. This is partly based on the fact that fulltime Australian workers are legally entitled to between 10 to 13 public holidays annually as well as 20 vacation days.
I don't need to account for leap year in the calculation because that is automatic in the range calculation date_ranges=ĭef buildDateRanges(start_year,start_month,start_day, end_year,end_month,end_day): According to the OECD, the average full-time Australian employee works approximately 1,683 hours a year, just four hours less than the OECD average. Common values are here: 5-day week: 230 working days per calendar year 6-day week: 280 working days per calendar year. Two parts: build the date ranges as tuples with a start and end date, build a dictionary whose key is the year and the values are the days.