https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17168
--- Comment #48 from Marcel de Rooy <m.de.r...@rijksmuseum.nl> --- + au => $au, + ao => $ao, You mean age under and age over. Not very clear names. Saw adjustments later.. Patch 1 + my ($y,$m,$d) = Today(); + if( $cat_from->dateofbirthrequired && $params->{au} ) { + my ($dy,$dm,$dd) =Add_Delta_YMD($y,$m,$d,-$cat_from->dateofbirthrequired,0,0); + $search_params->{dateofbirth}{'>'} = $dy."-".sprintf("%02d",$dm)."-".sprintf("%02d",$dd); + } Patch 2 + my $date_after = output_pref({ + dt => dt_from_string()->subtract( years => $cat_from->dateofbirthrequired), + dateonly => 1, + dateformat => 'sql' + }); + $search_params->{dateofbirth}{'>'} = $date_after; Instead of constructions like above, we normally use datetime_parser? my $dtf = Koha::Database->new->schema->storage->datetime_parser; my $rs = $class->_resultset->search( { returndate => { '<' => $dtf->format_datetime($older_than_date), }, -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list Koha-bugs@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/