/**
 * @author alle
 * Importante caricarlo a livello di layout  DOPO i javascript di calendar_date_select
 */


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().stripTime(); //CHANGED : imposta l'ora di default a zero
    if (!this.validYear(this.date.getFullYear())) this.date.setYear( (this.date.getFullYear() < this.yearRange().start) ? this.yearRange().start : this.yearRange().end);
    this.selected_date = new Date(this.date);
    this.use_time = /[0-9]:[0-9]{2}/.exec(value) ? true : false;
    this.date.setDate(1);
  };
  
//Date.prototype.getAMPMHour = function() { return this.getHours(); }
//Date.prototype.getAMPM = function() { return ""; }