home · contact · privacy
In Calendar view, highlight today's date.
authorChristian Heller <c.heller@plomlompom.de>
Thu, 30 May 2024 07:09:33 +0000 (09:09 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Thu, 30 May 2024 07:09:33 +0000 (09:09 +0200)
plomtask/http.py
templates/calendar.html

index 280b0f5cef64c904e5e64dede0f91b2a7cf800f7..537f21fff50f5dea2a75daf66edc368107ab0902 100644 (file)
@@ -120,7 +120,8 @@ class TaskHandler(BaseHTTPRequestHandler):
         days = Day.with_filled_gaps(days, start, end)
         for day in days:
             day.collect_calendarized_todos(self.conn)
-        return {'start': start, 'end': end, 'days': days}
+        today = date_in_n_days(0)
+        return {'start': start, 'end': end, 'days': days, 'today': today}
 
     def do_GET_day(self) -> dict[str, object]:
         """Show single Day of ?date=."""
index 4d672421329c95208cb1ca5050130c78065bfe9b..d7ec545bf3eb075b19cdce76d1fd7f9a7a9cf55d 100644 (file)
@@ -16,6 +16,9 @@ tr.month_row td {
 td.day_name {
   padding-right: 0.5em;
 }
+td.today {
+  font-weight: bold;
+}
 {% endblock %}
 
 
@@ -45,7 +48,7 @@ to <input name="end" value="{{end}}" />
 
 <tr>
 <td class="day_name">{{day.weekday|truncate(2,True,'',0)}}</td>
-<td><a href="day?date={{day.date}}">{{day.date}}</a></td>
+<td{% if day.date == today %} class="today"{% endif %}><a href="day?date={{day.date}}">{{day.date}}</a></td>
 <td>{{day.comment|e}}</td>
 </tr>