From: Christian Heller Date: Wed, 15 May 2024 08:18:51 +0000 (+0200) Subject: Improve visual/textual calendar structuring. X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/static/conditions?a=commitdiff_plain;h=f8118b1ed8615870b490566cf649d191f5877932;p=plomtask Improve visual/textual calendar structuring. --- 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.""" diff --git a/templates/calendar.html b/templates/calendar.html index 3acdbc6..715131a 100644 --- a/templates/calendar.html +++ b/templates/calendar.html @@ -1,14 +1,39 @@ {% extends 'base.html' %} +{% block css %} +tr.week_row td { height: 0.1em; background-color: black; padding: 0; margin: 0; } +tr.month_row td { border: 0.1em solid black; text-align: center; } +{% endblock %} + + + {% block content %}
from to
-