Skip to content

Commit

Permalink
fix(dhis2): week range calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
yannforget committed Aug 1, 2023
1 parent d7892cc commit 4842d35
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion openhexa/toolbox/dhis2/periods.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ def check_period(period: str):

@staticmethod
def to_datetime(period: str) -> datetime:
return datetime.strptime(period, "%YW%W")
# a dummy weekday is added so that strptime can be used
return datetime.strptime(period + "1", "%YW%W%w")

@staticmethod
def to_string(dt: datetime) -> str:
Expand Down

0 comments on commit 4842d35

Please sign in to comment.