handlers.py
changeset 72 5ade0288f2ec
parent 70 72edbbb414a7
child 73 5a7188bf2894
--- a/handlers.py	Mon Feb 09 14:07:19 2009 +0200
+++ b/handlers.py	Mon Feb 09 22:17:10 2009 +0200
@@ -85,6 +85,30 @@
         lines           = lines,
     )
 
+@preferences.handler(prefs.formatter, prefs.timezone)
+def channel_link (request, channel, timestamp, formatter, timezone) :
+    """
+        Display channel_date for specific UTC timestamp
+    """
+
+    # convert timestamp to user's timezone
+    timestamp = timestamp.astimezone(timezone)
+
+    # get latest events
+    lines = channel.source.get_date(timestamp)
+
+    # lines
+    lines = formatter.format_html(lines)
+
+    # render
+    return templates.render_to_response("channel_date",
+        req             = request,
+        prefs           = request.prefs,
+        channel         = channel,
+        date            = timestamp,
+        lines           = lines,
+    )
+
 @preferences.handler(prefs.timezone)
 def channel_calendar (request, channel, year, month, timezone) :
     """