Skip to content

Commit

Permalink
feat(dhis2): support comparison between periods
Browse files Browse the repository at this point in the history
  • Loading branch information
yannforget committed Aug 1, 2023
1 parent 4299c94 commit a1224bf
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions openhexa/toolbox/dhis2/periods.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,24 @@ def get_range(self, end) -> list:
def __str__(self):
return self.period

def __eq__(self, other):
return self.period == other.period

def __ne__(self, other):
return self.period != other.period

def __gt__(self, other):
return self.period > other.period

def __lt__(self, other):
return self.period < other.period

def __ge__(self, other):
return self.period >= other.period

def __le__(self, other):
return self.period <= other.period

def __repr__(self):
return f'"{self.period}"'

Expand Down

0 comments on commit a1224bf

Please sign in to comment.