--- a/helpers.py Mon Feb 09 06:12:11 2009 +0200
+++ b/helpers.py Mon Feb 09 06:19:12 2009 +0200
@@ -46,15 +46,38 @@
"""
return datetime.date(month.year, month.month, mday)
+
+ def now (self) :
+ """
+ Build current time
+ """
+
+ return self.ctx['timezone'].localize(datetime.datetime.now())
+
+ def today (self) :
+ """
+ Build today's date
+ """
+
+ return self.now().date()
def is_today (self, date) :
"""
- checks if the given date is today
+ Checks if the given date is today
"""
# construct current date
- return date == self.ctx['timezone'].localize(datetime.datetime.now()).date()
+ return date == self.today()
+ def is_this_month (self, month) :
+ """
+ Checks the given month is the current month
+ """
+
+ today = self.today()
+
+ return (month.year == today.year and month.month == today.month)
+
def prev_month_year (self, month) :
"""
Returns the year of the month before the given one
--- a/static/irclogs.css Mon Feb 09 06:12:11 2009 +0200
+++ b/static/irclogs.css Mon Feb 09 06:19:12 2009 +0200
@@ -188,6 +188,11 @@
float: right;
}
+table.calendar th.this-month a.next-month {
+ color: #d5d5d5;
+}
+
+
table.calendar tr.week-header th {
width: 14%
}
--- a/templates/channel_calendar.tmpl Mon Feb 09 06:12:11 2009 +0200
+++ b/templates/channel_calendar.tmpl Mon Feb 09 06:19:12 2009 +0200
@@ -4,7 +4,7 @@
<table class="calendar">
## table header - month name
<tr class="month-header">
- <th colspan="7">
+ <th colspan="7"${' class="this-month"' if h.is_this_month(month) else ''}>
<a href="${urls.channel_calendar.build(req, channel=channel, year=h.next_month_year(month), month=h.next_month(month))}" class="next-month">»</a>
<a href="${urls.channel_calendar.build(req, channel=channel, year=h.prev_month_year(month), month=h.prev_month(month))}" class="prev-month">«</a>
<span id="month-name">${h.fmt_month(month)}</span>