[open-ils-commits] r17405 - trunk/Open-ILS/web/js/ui/default/booking (senator)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Aug 31 13:05:24 EDT 2010
Author: senator
Date: 2010-08-31 13:05:20 -0400 (Tue, 31 Aug 2010)
New Revision: 17405
Modified:
trunk/Open-ILS/web/js/ui/default/booking/reservation.js
Log:
Booking: fix a bug in selecting the start/end date of a reservation
This bug would generally only manifest on certain days of the year
(1/29-31, 3/31, 5/31, 8/31, and 10/31).
Modified: trunk/Open-ILS/web/js/ui/default/booking/reservation.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/booking/reservation.js 2010-08-31 17:01:30 UTC (rev 17404)
+++ trunk/Open-ILS/web/js/ui/default/booking/reservation.js 2010-08-31 17:05:20 UTC (rev 17405)
@@ -8,6 +8,7 @@
dojo.require("dojo.data.ItemFileReadStore");
dojo.require("dijit.form.DateTextBox");
dojo.require("dijit.form.TimeTextBox");
+dojo.require("dojo.date.stamp");
dojo.requireLocalization("openils.booking", "reservation");
/*
@@ -60,7 +61,7 @@
};
}
TimestampRange.prototype.get_timestamp = function(when) {
- return this.any_widget.serialize(this[when]).
+ return dojo.date.stamp.toISOString(this[when]).
replace("T", " ").substr(0, 19);
};
TimestampRange.prototype.get_range = function() {
@@ -69,16 +70,14 @@
[this.get_timestamp("start"), this.get_timestamp("end")];
};
TimestampRange.prototype.update_from_widget = function(widget) {
- var when = widget.id.match(/(start|end)/)[1];
- var which = widget.id.match(/(date|time)/)[1];
+ var when = widget.name.match(/(start|end)/)[1];
+ var which = widget.name.match(/(date|time)/)[1];
- if (this.any_widget == undefined)
- this.any_widget = widget;
if (this.nodes[when][which] == undefined)
this.nodes[when][which] = widget.domNode; /* We'll need this later */
if (when && which) {
- this.update_timestamp(when, which, widget.value);
+ this.update_timestamp(when, which, widget.attr("value"));
}
this.compute_validity();
@@ -116,8 +115,8 @@
TimestampRange.prototype.update_timestamp = function(when, which, value) {
if (which == "date") {
this[when].setFullYear(value.getFullYear());
- this[when].setMonth(value.getMonth());
- this[when].setDate(value.getDate());
+ /* month and date MUST be done together */
+ this[when].setMonth(value.getMonth(), value.getDate());
} else { /* "time" */
this[when].setHours(value.getHours());
this[when].setMinutes(value.getMinutes());
More information about the open-ils-commits
mailing list