Permalink
Browse files

Fixed issue#11. Thanks to triemstr.

  • Loading branch information...
1 parent ecca4d8 commit 8b627ca6a7f7e0edae39305847c691a4e778c442 @sglee77 sglee77 committed Sep 7, 2010
Showing with 2 additions and 4 deletions.
  1. +2 −4 public/javascripts/calendar_date_select/calendar_date_select.js
@@ -313,7 +313,7 @@ CalendarDateSelect.prototype = {
validYear: function(year) { if (this.flexibleYearRange()) { return true;} else { return this.yearRange().include(year);} },
dayHover: function(element) {
var hover_date = new Date(this.selected_date);
- hover_date.setYear(element.year); hover_date.setMonth(element.month); hover_date.setDate(element.day);
+ hover_date.setFullYear(element.year, element.month, element.day);
this.updateFooter(hover_date.toFormattedString(this.use_time));
},
dayHoverOut: function(element) { this.updateFooter(); },
@@ -360,9 +360,7 @@ CalendarDateSelect.prototype = {
if ((this.target_element.disabled || this.target_element.readOnly) && this.options.get("popup") != "force") return false;
if (parts.get("day")) {
var t_selected_date = this.selected_date, vdc = this.options.get("valid_date_check");
- t_selected_date.setYear(parts.get("year"));
- t_selected_date.setMonth(parts.get("month"));
- t_selected_date.setDate(parts.get("day"));
+ t_selected_date.setFullYear(parts.get("year"), parts.get("month"), parts.get("day"));
if (vdc && ! vdc(t_selected_date.stripTime())) { return false; }
this.selected_date = t_selected_date;

0 comments on commit 8b627ca

Please sign in to comment.