Permalink
Browse files

Add "today" to navigation

  • Loading branch information...
1 parent df82aff commit 452923173c63dd9d8c30ee9d30f0743eea0c6084 @meldra committed Aug 9, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 brain/views.py
View
@@ -480,11 +480,14 @@ def syncmbox():
return True
def getnavigation(year=0, month=0):
+ today = date.today()
+
if month == 0:
- today = date.today()
month = today.month
- return '<div><a href="/search">Search</a> - Calendars: <a href="/%s">Year</a> | <a href="/%s/%s">Month</a></div>' % (str(year), str(year), str(month))
+ day = '%s/%s/%s' % (today.year, today.month, today.day)
+
+ return '<div><a href="/search">Search</a> - Calendars: <a href="/%s">Year</a> | <a href="/%s/%s">Month</a> - <a href="/%s">Today</a></div>' % (str(year), str(year), str(month), day)
def index(request, year=0, month=0, day=0):
now = datetime.now()

0 comments on commit 4529231

Please sign in to comment.