--- a/helpers.py Wed Feb 11 23:38:05 2009 +0200
+++ b/helpers.py Thu Feb 12 00:16:52 2009 +0200
@@ -46,10 +46,10 @@
def build_date (self, month, mday) :
"""
- Returns a datetime.date for the given (month.year, month.month, mday)
+ Returns a datetime.datetime for the given (month.year, month.month, mday)
"""
- return datetime.date(month.year, month.month, mday)
+ return self.ctx['prefs'][preferences.timezone].localize(datetime.datetime(month.year, month.month, mday))
def now (self) :
"""
@@ -65,13 +65,13 @@
return self.now().date()
- def is_today (self, date) :
+ def is_today (self, dt) :
"""
- Checks if the given date is today
+ Checks if the given datetime.datetime is today
"""
- # construct current date
- return date == self.today()
+ # compare with current date
+ return dt.date() == self.today()
def is_this_month (self, month) :
"""