Skip to content

Commit

Permalink
Merge pull request #56 from filips123/fix-menu-date-parser
Browse files Browse the repository at this point in the history
  • Loading branch information
filips123 authored Mar 5, 2023
2 parents 75543e9 + 8324d9a commit 17c56cf
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions API/gimvicurnik/updaters/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,7 @@ def get_document_effective(self, document: DocumentInfo) -> datetime.date:

# Get start of nth week of the month
first = datetime.date(year, month, 1)
diff = -first.weekday() if month == 9 else 7 - first.weekday()
diff = diff if diff < 7 else 0
new = first + datetime.timedelta(weeks=week - 1, days=diff)
new = first + datetime.timedelta(weeks=week - 1, days=-first.weekday())

return new

Expand Down

0 comments on commit 17c56cf

Please sign in to comment.