X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Roo%2Fform%2FDateField.js;h=34ec5791fd59e01d6b0dba5fde63a90ed3a6edba;hb=a9512966febab0a7572d0d750bf6262a7880eb82;hp=f27c62547eee559fbff29cd51c1d168f183b0735;hpb=87ae3d5dd8e0370e02ab47ba26a8052ea31d1f14;p=roojs1 diff --git a/Roo/form/DateField.js b/Roo/form/DateField.js index f27c62547e..34ec5791fd 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 + ")"); } @@ -151,6 +158,7 @@ Roo.extend(Roo.form.DateField, Roo.form.TriggerField, { Roo.form.DateField.superclass.onRender.call(this, ct, position); if (this.useIso) { //this.el.dom.removeAttribute('name'); + Roo.log("Changing name?"); this.el.dom.setAttribute('name', this.name + '____hidden___' ); this.hiddenField = this.el.insertSibling({ tag:'input', type:'hidden', name: this.name }, 'before', true); @@ -211,6 +219,14 @@ Roo.extend(Roo.form.DateField, Roo.form.TriggerField, { validateBlur : function(){ return !this.menu || !this.menu.isVisible(); }, + + getName: function() + { + // returns hidden if it's set.. + if (!this.rendered) {return ''}; + return !this.hiddenName && this.el.dom.name ? this.el.dom.name : (this.hiddenName || ''); + + }, /** * Returns the current date value of the date field. @@ -333,13 +349,28 @@ dateField.setValue('2006-5-4'); if(v){ this.setValue(v); } - } + }, - /** @cfg {Boolean} grow @hide */ - /** @cfg {Number} growMin @hide */ - /** @cfg {Number} growMax @hide */ - /** - * @hide - * @method autoSize + /*@ + * overide + * */ + isDirty : function() { + if(this.disabled) { + return false; + } + + if(typeof(this.startValue) === 'undefined'){ + return false; + } + + return String(this.getValue()) !== String(this.startValue); + + }, + // @overide + cleanLeadingSpace : function(e) + { + return; + } + }); \ No newline at end of file