X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/f5240829880f87e0cf581c6a296e436fdef0ef80..0494b8d9b9bb03ab6c22b34dae81261e3cd7e3e6:/examples/form/adv-vtypes.js diff --git a/examples/form/adv-vtypes.js b/examples/form/adv-vtypes.js index 1084c561..02f22c04 100644 --- a/examples/form/adv-vtypes.js +++ b/examples/form/adv-vtypes.js @@ -1,8 +1,8 @@ /*! - * Ext JS Library 3.3.0 - * Copyright(c) 2006-2010 Ext JS, Inc. - * licensing@extjs.com - * http://www.extjs.com/license + * Ext JS Library 3.3.1 + * Copyright(c) 2006-2010 Sencha Inc. + * licensing@sencha.com + * http://www.sencha.com/license */ // Add the additional 'advanced' VTypes Ext.apply(Ext.form.VTypes, { @@ -12,17 +12,19 @@ Ext.apply(Ext.form.VTypes, { if(!date){ return false; } - if (field.startDateField && (!this.dateRangeMax || (date.getTime() != this.dateRangeMax.getTime()))) { + if (field.startDateField) { var start = Ext.getCmp(field.startDateField); - start.setMaxValue(date); - start.validate(); - this.dateRangeMax = date; + if (!start.maxValue || (date.getTime() != start.maxValue.getTime())) { + start.setMaxValue(date); + start.validate(); + } } - else if (field.endDateField && (!this.dateRangeMin || (date.getTime() != this.dateRangeMin.getTime()))) { + else if (field.endDateField) { var end = Ext.getCmp(field.endDateField); - end.setMinValue(date); - end.validate(); - this.dateRangeMin = date; + if (!end.minValue || (date.getTime() != end.minValue.getTime())) { + end.setMinValue(date); + end.validate(); + } } /* * Always return true since we're only using this vtype to set the @@ -109,4 +111,4 @@ Ext.onReady(function(){ }); pwd.render('pw'); -}); \ No newline at end of file +});