I don't see any โcleanโ way to accomplish this, but I have a temporary workaround until you find something more suitable.
Try setting the TimeField minValue and maxValue to undefined or null , and then call generateStore() on your TimeField:
// private generateStore: function(initial){ var min = this.minValue || new Date(this.initDate).clearTime(), max = this.maxValue || new Date(this.initDate).clearTime().add('mi', (24 * 60) - 1), times = []; while(min <= max){ times.push(min.dateFormat(this.format)); min = min.add('mi', this.increment); } this.bindStore(times, initial); },
Yes, this is a private method, so usually you should not use it, but the method is usually called if you just reset minValue or maxValue, so you just skip the step. By setting both properties to null, the declaration for var min, max = will be the default value. You cannot get around this by calling setMinValue() or setMaxValue() , because it uses a private method that tries to parse the date from the value you pass to the methods (it will not work when parsing zero):
// private setLimit: function(value, isMin, initial){ var d; // will fail here if(Ext.isString(value)){ d = this.parseDate(value); // will fail as well }else if(Ext.isDate(value)){ d = value; } // will never make it here, because 'd' wasn't set above if(d){ var val = new Date(this.initDate).clearTime(); val.setHours(d.getHours(), d.getMinutes(), d.getSeconds(), d.getMilliseconds()); this[isMin ? 'minValue' : 'maxValue'] = val; if(!initial){ this.generateStore(); } } }
Update:
A cleaner approach would be to extend the TimeField and add a resetMinAndMax method that does the above (set minValue / maxValue to null, invoke the creation of the repository) or add a method to the override. This way you can avoid calls to "private" generateStore() everywhere.
source share