X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/decks/%7B%7Bdeck_id%7D%7D/cards/%7B%7Bcard_id%7D%7D/form?a=blobdiff_plain;f=plomtask%2Fdays.py;h=5e975602d112a81f71b7bafb47b2939f9084d365;hb=f8118b1ed8615870b490566cf649d191f5877932;hp=0e07bf7aeb8837fc28031d2d924d65d17b0256bd;hpb=32c0e270d3c521329c0b7a988b25585e6a275ff5;p=plomtask diff --git a/plomtask/days.py b/plomtask/days.py index 0e07bf7..5e97560 100644 --- a/plomtask/days.py +++ b/plomtask/days.py @@ -78,6 +78,17 @@ class Day(BaseModel[str]): assert isinstance(self.id_, str) return self.id_ + @property + def first_of_month(self) -> bool: + """Return what month self.date is part of.""" + assert isinstance(self.id_, str) + return self.id_[-2:] == '01' + + @property + def month_name(self) -> str: + """Return what month self.date is part of.""" + return self.datetime.strftime('%B') + @property def weekday(self) -> str: """Return what weekday matches self.date."""