+ * The default date format string which can be overriden for localization support. The format must be valid
+ * according to {@link Ext.Date#parse}.
+ */
+ format : "m/d/Y",
+<span id='Ext-form-field-Date-cfg-altFormats'> /**
+</span> * @cfg {String} altFormats
+ * Multiple date formats separated by "|" to try when parsing a user input value and it does not match the defined
+ * format.
+ */
+ altFormats : "m/d/Y|n/j/Y|n/j/y|m/j/y|n/d/y|m/j/Y|n/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d|Y-m-d|n-j|n/j",
+<span id='Ext-form-field-Date-cfg-disabledDaysText'> /**
+</span> * @cfg {String} disabledDaysText
+ * The tooltip to display when the date falls on a disabled day.
+ */
+ disabledDaysText : "Disabled",
+<span id='Ext-form-field-Date-cfg-disabledDatesText'> /**
+</span> * @cfg {String} disabledDatesText
+ * The tooltip text to display when the date falls on a disabled date.
+ */
+ disabledDatesText : "Disabled",
+<span id='Ext-form-field-Date-cfg-minText'> /**
+</span> * @cfg {String} minText
+ * The error text to display when the date in the cell is before {@link #minValue}.
+ */
+ minText : "The date in this field must be equal to or after {0}",
+<span id='Ext-form-field-Date-cfg-maxText'> /**
+</span> * @cfg {String} maxText
+ * The error text to display when the date in the cell is after {@link #maxValue}.
+ */
+ maxText : "The date in this field must be equal to or before {0}",
+<span id='Ext-form-field-Date-cfg-invalidText'> /**
+</span> * @cfg {String} invalidText
+ * The error text to display when the date in the field is invalid.
+ */
+ invalidText : "{0} is not a valid date - it must be in the format {1}",
+<span id='Ext-form-field-Date-cfg-triggerCls'> /**
+</span> * @cfg {String} [triggerCls='x-form-date-trigger']
+ * An additional CSS class used to style the trigger button. The trigger will always get the class 'x-form-trigger'
+ * and triggerCls will be **appended** if specified (default class displays a calendar icon).
+ */
+ triggerCls : Ext.baseCSSPrefix + 'form-date-trigger',
+<span id='Ext-form-field-Date-cfg-showToday'> /**
+</span> * @cfg {Boolean} showToday
+ * false to hide the footer area of the Date picker containing the Today button and disable the keyboard handler for
+ * spacebar that selects the current date.
+ */
+ showToday : true,
+<span id='Ext-form-field-Date-cfg-minValue'> /**
+</span> * @cfg {Date/String} minValue
+ * The minimum allowed date. Can be either a Javascript date object or a string date in a valid format.
+ */
+<span id='Ext-form-field-Date-cfg-maxValue'> /**
+</span> * @cfg {Date/String} maxValue
+ * The maximum allowed date. Can be either a Javascript date object or a string date in a valid format.
+ */
+<span id='Ext-form-field-Date-cfg-disabledDays'> /**
+</span> * @cfg {Number[]} disabledDays
+ * An array of days to disable, 0 based. Some examples:
+ *
+ * // disable Sunday and Saturday:
+ * disabledDays: [0, 6]
+ * // disable weekdays:
+ * disabledDays: [1,2,3,4,5]
+ */
+<span id='Ext-form-field-Date-cfg-disabledDates'> /**
+</span> * @cfg {String[]} disabledDates
+ * An array of "dates" to disable, as strings. These strings will be used to build a dynamic regular expression so
+ * they are very powerful. Some examples:
+ *
+ * // disable these exact dates:
+ * disabledDates: ["03/08/2003", "09/16/2003"]
+ * // disable these days for every year:
+ * disabledDates: ["03/08", "09/16"]
+ * // only match the beginning (useful if you are using short years):
+ * disabledDates: ["^03/08"]
+ * // disable every day in March 2006:
+ * disabledDates: ["03/../2006"]
+ * // disable every day in every March:
+ * disabledDates: ["^03"]
+ *
+ * Note that the format of the dates included in the array should exactly match the {@link #format} config. In order
+ * to support regular expressions, if you are using a {@link #format date format} that has "." in it, you will have
+ * to escape the dot when restricting dates. For example: `["03\\.08\\.03"]`.
+ */
+
+<span id='Ext-form-field-Date-cfg-submitFormat'> /**
+</span> * @cfg {String} submitFormat
+ * The date format string which will be submitted to the server. The format must be valid according to {@link
+ * Ext.Date#parse} (defaults to {@link #format}).
+ */
+
+ // in the absence of a time value, a default value of 12 noon will be used
+ // (note: 12 noon was chosen because it steers well clear of all DST timezone changes)
+ initTime: '12', // 24 hour format
+
+ initTimeFormat: 'H',
+
+ matchFieldWidth: false,
+<span id='Ext-form-field-Date-cfg-startDay'> /**
+</span> * @cfg {Number} startDay
+ * Day index at which the week should begin, 0-based (defaults to Sunday)
+ */
+ startDay: 0,
+
+ initComponent : function(){
+ var me = this,
+ isString = Ext.isString,
+ min, max;
+
+ min = me.minValue;
+ max = me.maxValue;
+ if(isString(min)){
+ me.minValue = me.parseDate(min);
+ }
+ if(isString(max)){
+ me.maxValue = me.parseDate(max);
+ }
+ me.disabledDatesRE = null;
+ me.initDisabledDays();
+
+ me.callParent();
+ },
+
+ initValue: function() {
+ var me = this,
+ value = me.value;
+
+ // If a String value was supplied, try to convert it to a proper Date
+ if (Ext.isString(value)) {
+ me.value = me.rawToValue(value);
+ }
+
+ me.callParent();
+ },
+
+ // private
+ initDisabledDays : function(){
+ if(this.disabledDates){
+ var dd = this.disabledDates,
+ len = dd.length - 1,
+ re = "(?:";
+
+ Ext.each(dd, function(d, i){
+ re += Ext.isDate(d) ? '^' + Ext.String.escapeRegex(d.dateFormat(this.format)) + '$' : dd[i];
+ if (i !== len) {
+ re += '|';
+ }
+ }, this);
+ this.disabledDatesRE = new RegExp(re + ')');
+ }
+ },
+
+<span id='Ext-form-field-Date-method-setDisabledDates'> /**
+</span> * Replaces any existing disabled dates with new values and refreshes the Date picker.
+ * @param {String[]} disabledDates An array of date strings (see the {@link #disabledDates} config for details on
+ * supported values) used to disable a pattern of dates.
+ */
+ setDisabledDates : function(dd){
+ var me = this,
+ picker = me.picker;
+
+ me.disabledDates = dd;
+ me.initDisabledDays();
+ if (picker) {
+ picker.setDisabledDates(me.disabledDatesRE);
+ }
+ },
+
+<span id='Ext-form-field-Date-method-setDisabledDays'> /**
+</span> * Replaces any existing disabled days (by index, 0-6) with new values and refreshes the Date picker.
+ * @param {Number[]} disabledDays An array of disabled day indexes. See the {@link #disabledDays} config for details on
+ * supported values.
+ */
+ setDisabledDays : function(dd){
+ var picker = this.picker;
+
+ this.disabledDays = dd;
+ if (picker) {
+ picker.setDisabledDays(dd);
+ }
+ },
+
+<span id='Ext-form-field-Date-method-setMinValue'> /**
+</span> * Replaces any existing {@link #minValue} with the new value and refreshes the Date picker.
+ * @param {Date} value The minimum date that can be selected
+ */
+ setMinValue : function(dt){
+ var me = this,
+ picker = me.picker,
+ minValue = (Ext.isString(dt) ? me.parseDate(dt) : dt);
+
+ me.minValue = minValue;
+ if (picker) {
+ picker.minText = Ext.String.format(me.minText, me.formatDate(me.minValue));
+ picker.setMinDate(minValue);
+ }
+ },
+
+<span id='Ext-form-field-Date-method-setMaxValue'> /**
+</span> * Replaces any existing {@link #maxValue} with the new value and refreshes the Date picker.
+ * @param {Date} value The maximum date that can be selected