Bug 9811 - datetime does not respect DateFormat-system prefrence
authorOlli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>
Fri, 14 Mar 2014 11:39:03 +0000 (12:39 +0100)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Tue, 1 Jul 2014 12:58:11 +0000 (09:58 -0300)
To test:
Try searching by the date of birth using the left filter column. Good luck.

After applying this patch:
You can search using your preferred DateFormat.

Merci bocu

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
svc/members/search

index 56b9e86..1b3a02a 100755 (executable)
@@ -24,6 +24,7 @@ use C4::Auth qw( get_template_and_user );
 use C4::Output qw( output_with_http_headers );
 use C4::Utils::DataTables qw( dt_get_params );
 use C4::Utils::DataTables::Members qw( search );
+use Koha::DateUtils qw( output_pref dt_from_string );
 
 my $input = new CGI;
 
@@ -44,6 +45,10 @@ my $branchcode = $input->param('branchcode');
 my $searchtype = $input->param('searchtype');
 my $searchfieldstype = $input->param('searchfieldstype');
 
+if ( $searchfieldstype eq "dateofbirth" ) {
+    $searchmember = output_pref({dt => dt_from_string($searchmember), dateformat => 'iso', dateonly => 1});
+}
+
 # variable information for DataTables (id)
 my $sEcho = $input->param('sEcho');