Results 1 to 2 of 2

Thread: Datepicker: default month still this month when min and max date set to future month

  1. #1

    Default Datepicker: default month still this month when min and max date set to future month

    If you set the min and max dates of datepicker to a future time period (like June 12-25, 2009) the datepicker will default drop down showing the user this month - with no selectable values. The user has to know to scroll to June.

    Is there a way to change the "default" month? I know this has been asked before but there were no replies.

    And although this isn't a bug, I think the default behavior of the datepicker SHOULD be to drop down with a default month where there are selectable dates.

  2. #2

    Default

    Never mind. Wrong board and I figured out a solution...


    Code:
    Ext.override(Ext.form.DateField,
    {
    onTriggerClick: function() {
    if (this.disabled) {
    return;
    }
    if (this.menu == null) {
    this.menu = new Ext.menu.DateMenu();
    }
    Ext.apply(this.menu.picker, {
    startDay: this.startDay,
    minDate: this.minValue,
    maxDate: this.maxValue,
    disabledDatesRE: this.ddMatch,
    disabledDatesText: this.disabledDatesText,
    disabledDays: this.disabledDays,
    disabledDaysText: this.disabledDaysText,
    format: this.format,
    showToday: this.showToday,
    minText: String.format(this.minText, this.formatDate(this.minValue)),
    maxText: String.format(this.maxText, this.formatDate(this.maxValue))
    });
    this.menu.on(Ext.apply({}, this.menuListeners, {
    scope: this
    }));
    this.menu.picker.setValue(this.getValue() || this.minValue || new Date());  // add this.minValue here ...
    this.menu.show(this.el, "tl-bl?");
    }
    });

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •