From 7183d444b2bddc23c46d1b11599a4e43a60002d1 Mon Sep 17 00:00:00 2001
From: Ernesto Rico-Schmidt <e.rico.schmidt@gmail.com>
Date: Mon, 25 Apr 2011 18:04:41 +0200
Subject: integrated jQuery UI's datepicker.


diff --git a/TODO b/TODO
index 7ffd2ac..b43be36 100644
--- a/TODO
+++ b/TODO
@@ -1,4 +1,3 @@
-* integrate calendar into day schedule view
 * integrate tinyMCE into admin site
 * integrate open ID
 * integrate Disqus
diff --git a/templates/program/day_schedule.html b/templates/program/day_schedule.html
index 275930d..cf71bd7 100644
--- a/templates/program/day_schedule.html
+++ b/templates/program/day_schedule.html
@@ -1,6 +1,10 @@
 <html>
 <head>
     <title>Day schedule: {{ day|date:"l, d.m.Y" }}</title>
+    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
+    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/jquery-ui.min.js"></script>
+    <script type="text/javascript" src="http://jquery-ui.googlecode.com/svn/trunk/ui/i18n/jquery.ui.datepicker-de.js"></script>
+    <link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/themes/base/jquery-ui.css" rel="stylesheet" />
 </head>
 <body>
 
@@ -12,7 +16,7 @@
 </div>
 <div id="filter-topic">
   <dl id="filter-header" class="portlet">
-    <dt class="portletHeader"><span>Filter<span></dt>
+    <dt class="portletHeader"><span>Filter</span></dt>
   </dl>
 {% musicfocus %}
 {% showinformation %}
@@ -53,6 +57,16 @@
     </div>
 </div>
 
+<script>
+    $(function() {
+        $("#calendar").datepicker({
+            defaultDate: location.href.split('/').slice(4, 7).reverse().join('.'),
+            onSelect: function(dateText, inst) {
+                location = '/program/' + dateText.split('.').reverse().join('/');
+            }
+        });
+    })
+</script>
 
 </body>
 </html>
-- 
cgit v0.10.2