diff gpp/gcalendar/views.py @ 345:f7fbb404241f

Fix #164; have the calendar display times in the user's time zone. If the user isn't logged in, just use US/Pacific. Default the calendar mode to agenda mode.
author Brian Neal <bgneal@gmail.com>
date Mon, 28 Feb 2011 01:58:38 +0000
parents dbd703f7d63a
children
line wrap: on
line diff
--- a/gpp/gcalendar/views.py	Sun Feb 27 22:58:48 2011 +0000
+++ b/gpp/gcalendar/views.py	Mon Feb 28 01:58:38 2011 +0000
@@ -18,7 +18,15 @@
 
 
 def index(request):
+    user = request.user
+    if user.is_authenticated():
+        profile = user.get_profile()
+        tz = profile.time_zone
+    else:
+        tz = 'US/Pacific'
+
     return render_to_response('gcalendar/index.html', {
+        'tz': tz,
         },
         context_instance = RequestContext(request))