[Koha-patches] [PATCH] Bug 8596 - Reports interface date picker doesn't force ISO formatted dates

Owen Leonard oleonard at myacpl.org
Tue Aug 14 16:15:07 CEST 2012


Datepickers follow Koha's preference for date format, but the
guided reports system doesn't intelligently handle different date
formats. ISO is required. This patch adds some additional
configuration to override the date format.

To test, create a guided or SQL report which takes a date
parameter. The datepicker fields should return an ISO-formatted
date.
---
 .../en/modules/reports/guided_reports_start.tt     |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt
index 3d9a7ab..a152822 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt
@@ -56,6 +56,9 @@ $(document).ready(function(){
     positionFixed: false,
     size:          20
   });
+  // redefine the datepicker's default because reports require ISO
+  // http://jqueryui.com/demos/datepicker/#option-dateFormat
+  $( ".datepicker" ).datepicker( "option", "dateFormat", "yy-mm-dd" );
 });
 //]]>
 </script>
-- 
1.7.9.5



More information about the Koha-patches mailing list