future hold request followup 4 - date controls
authorGalen Charlton <gmcharlt@gmail.com>
Tue, 11 Aug 2009 23:21:36 +0000 (19:21 -0400)
committerGalen Charlton <gmcharlt@gmail.com>
Tue, 11 Aug 2009 23:23:40 +0000 (19:23 -0400)
Fixed the calendar control for selecting the request
date in staff and OPAC so that user can explicitly
select current date and all days in the future.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tmpl

index dff76ae..4a68c28 100644 (file)
@@ -291,9 +291,10 @@ function checkMultiHold() {
                //<![CDATA[
                function validate1(date) {
                        var today = new Date();
-                       if ( date < today ) {
-                               return false;
-                       } else if ( date.getDate() == today.getDate() && date.getMonth() == today.getMonth() && date.getFullYear() == today.getFullYear() ) {
+                       if ( (date > today) ||
+                    ( date.getDate() == today.getDate() &&
+                      date.getMonth() == today.getMonth() &&
+                      date.getFullYear() == today.getFullYear() ) ) {
                                return false;
                        } else {
                                return true;
index 562dfe6..a2a8266 100644 (file)
                        document.getElementById("reserve_date_<!-- TMPL_VAR NAME="biblionumber" -->").parentNode.appendChild( cal_img );
 
                        function validate<!-- TMPL_VAR NAME="biblionumber" -->(date) {
-                          var today = new Date();
-                          if ( date < today ) {
-                             return true;
-                          } else {
-                             return false;
-                          }
+                           var today = new Date();
+                if ( (date > today) ||
+                        ( date.getDate() == today.getDate() &&
+                          date.getMonth() == today.getMonth() &&
+                          date.getFullYear() == today.getFullYear() ) ) {
+                    return false;
+                } else {
+                    return true;
+                }
                        };
                        Calendar.setup(
                        {