[Koha-patches] [PATCH 4/4] future hold request followup 4 - date controls
Galen Charlton
gmcharlt at gmail.com
Wed Aug 12 01:23:27 CEST 2009
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.
---
.../prog/en/modules/reserve/request.tmpl | 7 ++++---
.../opac-tmpl/prog/en/modules/opac-reserve.tmpl | 15 +++++++++------
2 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tmpl
index dff76ae..4a68c28 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tmpl
@@ -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;
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tmpl
index 562dfe6..a2a8266 100644
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tmpl
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tmpl
@@ -316,12 +316,15 @@
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(
{
--
1.5.6.5
More information about the Koha-patches
mailing list