Use datepicker() to select dates for reports.
authorIain Patterson <me@iain.cx>
Tue, 15 Oct 2013 09:05:48 +0000 (05:05 -0400)
committerIain Patterson <me@iain.cx>
Tue, 15 Oct 2013 09:05:48 +0000 (05:05 -0400)
lib/report.php

index d8699d2..f06e8ca 100644 (file)
     $oldest = date('Y-m-d', $date);
     $then = $date;
 
-    echo "<select name=\"from\">\n";
-    for ($date = $then; $date <= $now; $date += 86400) {
-      option("from", date('Y-m-d', $date), date('j F Y', $date), $from);
-    }
-    echo "</select> to <select name=\"to\">\n";
-    for ($date = $then; $date <= $now; $date += 86400) {
-      option("to", date('Y-m-d', $date), date('j F Y', $date), $to);
-    }
-    echo "</select>\n";
+    datepicker("from", $from, true, null, false, "to");
+    echo " to ";
+    datepicker("to", $to, true, "from", false);
 
     submit("show_reports", "Show");
     end_form();