X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Roo%2Fform%2FDateField.js;h=2f96d0b407dfce42f8ea9513d69156756a9c17db;hb=0705b9209b1625c041368fa457b7502e29c0c5b6;hp=61e49354d3751f2970fde79f99f4bcd73b8bf865;hpb=9b333a47bc6755f71e3ecc4aec230be857a0726f;p=roojs1 diff --git a/Roo/form/DateField.js b/Roo/form/DateField.js index 61e49354d3..2f96d0b407 100644 --- a/Roo/form/DateField.js +++ b/Roo/form/DateField.js @@ -17,7 +17,8 @@ * Create a new DateField * @param {Object} config */ -Roo.form.DateField = function(config){ +Roo.form.DateField = function(config) +{ Roo.form.DateField.superclass.constructor.call(this, config); this.addEvents({ @@ -33,15 +34,21 @@ Roo.form.DateField = function(config){ }); - if(typeof this.minValue == "string") this.minValue = this.parseDate(this.minValue); - if(typeof this.maxValue == "string") this.maxValue = this.parseDate(this.maxValue); + if(typeof this.minValue == "string") { + this.minValue = this.parseDate(this.minValue); + } + if(typeof this.maxValue == "string") { + this.maxValue = this.parseDate(this.maxValue); + } this.ddMatch = null; if(this.disabledDates){ var dd = this.disabledDates; var re = "(?:"; for(var i = 0; i < dd.length; i++){ re += dd[i]; - if(i != dd.length-1) re += "|"; + if(i != dd.length-1) { + re += "|"; + } } this.ddMatch = new RegExp(re + ")"); } @@ -359,5 +366,15 @@ dateField.setValue('2006-5-4'); return String(this.getValue()) !== String(this.startValue); + }, + // @overide + cleanLeadingSpace : function(e) + { + if ( this.inputType == 'file') { + return; + } + + this.setValue((this.getValue() + '').replace(/^\s+/,'')); } + }); \ No newline at end of file