From f8118b1ed8615870b490566cf649d191f5877932 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Wed, 15 May 2024 10:18:51 +0200 Subject: [PATCH] Improve visual/textual calendar structuring. --- plomtask/days.py | 11 +++++++++++ templates/calendar.html | 31 ++++++++++++++++++++++++++++--- templates/day.html | 2 +- templates/todo.html | 2 ++ 4 files changed, 42 insertions(+), 4 deletions(-) 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
-