Alien-Web-ExtJS-V3
view release on metacpan or search on metacpan
share/docs/source/DateField.html view on Meta::CPAN
* The error text to display when the date in the field is invalid (defaults to
* <tt>'{value} is not a valid date - it must be in the format {format}'</tt>).
*/
invalidText : "{0} is not a valid date - it must be in the format {1}",
<span id='Ext-form-DateField-cfg-triggerClass'> /**
</span> * @cfg {String} triggerClass
* An additional CSS class used to style the trigger button. The trigger will always get the
* class <tt>'x-form-trigger'</tt> and <tt>triggerClass</tt> will be <b>appended</b> if specified
* (defaults to <tt>'x-form-date-trigger'</tt> which displays a calendar icon).
*/
triggerClass : 'x-form-date-trigger',
<span id='Ext-form-DateField-cfg-showToday'> /**
</span> * @cfg {Boolean} showToday
* <tt>false</tt> to hide the footer area of the DatePicker containing the Today button and disable
* the keyboard handler for spacebar that selects the current date (defaults to <tt>true</tt>).
*/
showToday : true,
<span id='Ext-form-DateField-cfg-startDay'> /**
</span> * @cfg {Number} startDay
* Day index at which the week should begin, 0-based (defaults to 0, which is Sunday)
*/
startDay : 0,
<span id='Ext-form-DateField-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 (defaults to null).
*/
<span id='Ext-form-DateField-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 (defaults to null).
*/
<span id='Ext-form-DateField-cfg-disabledDays'> /**
</span> * @cfg {Array} disabledDays
* An array of days to disable, 0 based (defaults to null). Some examples:<pre><code>
// disable Sunday and Saturday:
disabledDays: [0, 6]
// disable weekdays:
disabledDays: [1,2,3,4,5]
* </code></pre>
*/
<span id='Ext-form-DateField-cfg-disabledDates'> /**
</span> * @cfg {Array} 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:<pre><code>
// 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"]
* </code></pre>
* 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: <tt>["03\\.08\\.03"]</tt>.
*/
<span id='Ext-form-DateField-cfg-autoCreate'> /**
</span> * @cfg {String/Object} autoCreate
* A {@link Ext.DomHelper DomHelper element specification object}, or <tt>true</tt> for the default element
* specification object:<pre><code>
* autoCreate: {tag: "input", type: "text", size: "10", autocomplete: "off"}
* </code></pre>
*/
<span id='Ext-form-DateField-property-defaultAutoCreate'> // private
</span> defaultAutoCreate : {tag: "input", type: "text", size: "10", autocomplete: "off"},
<span id='Ext-form-DateField-property-initTime'> // in the absence of a time value, a default value of 12 noon will be used
</span> // (note: 12 noon was chosen because it steers well clear of all DST timezone changes)
<span id='Ext-form-DateField-property-initTimeFormat'> initTime: '12', // 24 hour format
</span>
initTimeFormat: 'H',
<span id='Ext-form-DateField-method-safeParse'> // PUBLIC -- to be documented
</span> safeParse : function(value, format) {
if (Date.formatContainsHourInfo(format)) {
// if parse format contains hour information, no DST adjustment is necessary
return Date.parseDate(value, format);
} else {
// set time to 12 noon, then clear the time
var parsedDate = Date.parseDate(value + ' ' + this.initTime, format + ' ' + this.initTimeFormat);
if (parsedDate) {
return parsedDate.clearTime();
}
}
},
<span id='Ext-form-DateField-method-initComponent'> initComponent : function(){
</span> Ext.form.DateField.superclass.initComponent.call(this);
this.addEvents(
<span id='Ext-form-DateField-event-select'> /**
</span> * @event select
* Fires when a date is selected via the date picker.
* @param {Ext.form.DateField} this
* @param {Date} date The date that was selected
*/
'select'
);
if(Ext.isString(this.minValue)){
this.minValue = this.parseDate(this.minValue);
}
if(Ext.isString(this.maxValue)){
this.maxValue = this.parseDate(this.maxValue);
}
this.disabledDatesRE = null;
this.initDisabledDays();
},
<span id='Ext-form-DateField-method-initEvents'> initEvents: function() {
</span> Ext.form.DateField.superclass.initEvents.call(this);
this.keyNav = new Ext.KeyNav(this.el, {
"down": function(e) {
this.onTriggerClick();
},
scope: this,
forceKeyDown: true
});
},
<span id='Ext-form-DateField-method-initDisabledDays'> // private
</span> 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.escapeRe(d.dateFormat(this.format)) + '$' : dd[i];
if(i != len){
re += '|';
}
}, this);
this.disabledDatesRE = new RegExp(re + ')');
}
},
<span id='Ext-form-DateField-method-setDisabledDates'> /**
</span> * Replaces any existing disabled dates with new values and refreshes the DatePicker.
* @param {Array} disabledDates An array of date strings (see the <tt>{@link #disabledDates}</tt> config
* for details on supported values) used to disable a pattern of dates.
*/
setDisabledDates : function(dd){
this.disabledDates = dd;
this.initDisabledDays();
if(this.menu){
this.menu.picker.setDisabledDates(this.disabledDatesRE);
}
},
<span id='Ext-form-DateField-method-setDisabledDays'> /**
</span> * Replaces any existing disabled days (by index, 0-6) with new values and refreshes the DatePicker.
* @param {Array} disabledDays An array of disabled day indexes. See the <tt>{@link #disabledDays}</tt>
* config for details on supported values.
*/
setDisabledDays : function(dd){
this.disabledDays = dd;
if(this.menu){
this.menu.picker.setDisabledDays(dd);
}
},
<span id='Ext-form-DateField-method-setMinValue'> /**
</span> * Replaces any existing <tt>{@link #minValue}</tt> with the new value and refreshes the DatePicker.
* @param {Date} value The minimum date that can be selected
*/
setMinValue : function(dt){
this.minValue = (Ext.isString(dt) ? this.parseDate(dt) : dt);
if(this.menu){
this.menu.picker.setMinDate(this.minValue);
}
},
<span id='Ext-form-DateField-method-setMaxValue'> /**
</span> * Replaces any existing <tt>{@link #maxValue}</tt> with the new value and refreshes the DatePicker.
* @param {Date} value The maximum date that can be selected
*/
setMaxValue : function(dt){
this.maxValue = (Ext.isString(dt) ? this.parseDate(dt) : dt);
if(this.menu){
this.menu.picker.setMaxDate(this.maxValue);
}
},
<span id='Ext-form-DateField-method-getErrors'> /**
</span> * Runs all of NumberFields validations and returns an array of any errors. Note that this first
* runs TextField's validations, so the returned array is an amalgamation of all field errors.
* The additional validation checks are testing that the date format is valid, that the chosen
* date is within the min and max date constraints set, that the date chosen is not in the disabledDates
( run in 1.473 second using v1.01-cache-2.11-cpan-119454b85a5 )