| |   |
| 92 | 92 | valid_date_check: nil |
| 93 | 93 | }).merge(options || {}); |
| 94 | 94 | |
| 95 | | this.selection_made = $F(this.target_element).strip()!==""; |
| 96 | 95 | this.use_time = this.options.get("time"); |
| 97 | 96 | |
| 98 | 97 | this.callback("before_show") |
| … | … | |
| 342 | 342 | parseDate: function() |
| 343 | 343 | { |
| 344 | 344 | var value = $F(this.target_element).strip() |
| 345 | this.selection_made = (value != ""); |
| 345 | 346 | this.date = value=="" ? NaN : Date.parseFormattedString(this.options.get("date") || value); |
| 346 | 347 | if (isNaN(this.date)) this.date = new Date(); |
| 347 | 348 | if (!this.validYear(this.date.getFullYear())) this.date.setYear( (this.date.getFullYear() < this.yearRange().start) ? this.yearRange().start : this.yearRange().end); |
| toggle raw diff |
--- a/public/javascripts/calendar_date_select/calendar_date_select.js
+++ b/public/javascripts/calendar_date_select/calendar_date_select.js
@@ -92,7 +92,6 @@ CalendarDateSelect.prototype = {
valid_date_check: nil
}).merge(options || {});
- this.selection_made = $F(this.target_element).strip()!=="";
this.use_time = this.options.get("time");
this.callback("before_show")
@@ -343,6 +342,7 @@ CalendarDateSelect.prototype = {
parseDate: function()
{
var value = $F(this.target_element).strip()
+ this.selection_made = (value != "");
this.date = value=="" ? NaN : Date.parseFormattedString(this.options.get("date") || value);
if (isNaN(this.date)) this.date = new Date();
if (!this.validYear(this.date.getFullYear())) this.date.setYear( (this.date.getFullYear() < this.yearRange().start) ? this.yearRange().start : this.yearRange().end); |