I am using ExtJS 2.1 and I have the following problem, I hate a 'datefield'. Now the date has to be entered in the format 'MM/DD/YYYY'. The problem is if the user enters something like '21/17' or '16/05' it gets converted to a valid date. (21/17 gets converted to 9/17/2015 and 16/05 gets converted to 4/05/2015). How do I override this behavior? I tried writing my own validator but that didn't help either, even if my validator returns 'false' the conversion still happens. Here is the code below:
var d = new Ext.form.DateField({
            el: el.dom,
            id: id,
            format: 'm/d/Y',
            hideTrigger: false,
            allowBlank: true,
            disabled: isDisabled,
            validator: testForShortDate,
            validateOnBlur: true,
            minLength:6,
            //validationEvent: false,  //string or boolean
            invalidText: 'Enter date as MM/DD/YYYY',
            menuListeners: Ext.applyIf({
                select: function (m, d) {
                    Ext.form.DateField.prototype.menuListeners.select.apply(this, arguments);
                    this.focus.defer(100, this);
                    onDateSelect(m, d, this);
                }
            })
        });
        d.render();
d
function testForShortDate(date) {
if (date.split("/").length != 3) {
    console.log(date.split("/").length);
    return false;
}
return true;
Can anyone help?