I'll risk offering amateur code to a bunch of coders. One of my searches is for an historical archive of PDFs going back 12 years. Whilst the old ones are still of value, we like to strongly steer people to the newer ones first (the old ones require broad knowledge of other product changes that may have occurred in the interim).
So apart from now using sort by date, I've also used some hidden fields in my custom search form to default it to searching the last year of bulletin (if I'd been evil I'd have also set the styles for the date picker to "hidden" but instead I was nice).
So apart from now using sort by date, I've also used some hidden fields in my custom search form to default it to searching the last year of bulletin (if I'd been evil I'd have also set the styles for the date picker to "hidden" but instead I was nice).
Code:
<script language="JavaScript1.2" type="text/javascript"> var today = new Date(); var dd = today.getDate(); if(dd<10) dd='0'+dd; var mm = today.getMonth()+1; if(mm<10) mm='0'+mm; var yyyy = today.getFullYear(); var YYYY = yyyy-1; var thisYear = dd+'/'+mm+'/'+yyyy; var lastYear = dd+'/'+mm+'/'+YYYY; document.write('<input type="hidden" name="zoom_datefrom" value="' + lastYear + '" />'); document.write('<input type="hidden" name="zoom_dateto" value="' + thisYear + '" />'); </script>
Comment