Success! Looks like we've fixed this one. According to our records the fix was applied for
EXTJS-18741
in
6.0.1.
-
Sencha Premium Member
TimeField issue when default Value does not match increment
Please have a look at the following fiddle:
https://fiddle.sencha.com/#fiddle/ra6
I specified an interval of 15. The first field has a value of 15:00, and everything works. The second one has a value of 15:03 (which is not part of the suggested values, but since snapToIncrement is false, it should still be valid) and you cannot select a value:
A js error occurs:
Uncaught TypeError: date1.getTime is not a function
Thanks for your help,
TkDodo
-
Thanks for the report! I have opened a bug in our bug tracker.
-
Sencha Premium Member
It's nice to hear that you have fixed this in 6.0.1. However, we are using 5.1 and are not planning on upgrading soon. Is there any chance that you will fix this in a 5.x release or provide a workaround / monkey patch for that?
-
Hi @TkDodo,
Maybe, it is already not actual for you, but still - we used this override for 5.1.1.
Code:
Ext.form.field.Time.override({
isEqual: function (v1, v2) {
var fromArray = Ext.Array.from,
isEqual = Ext.Date.isEqual,
i, len;
v1 = fromArray(v1);
v2 = fromArray(v2);
len = v1.length;
if (len !== v2.length) {
return false;
}
for (i = 0; i < len; i++) {
if (!Ext.isDate(v2[i]) || !Ext.isDate(v1[i] || !isEqual(v2[i], v1[i]) {
return false;
}
}
return true;
}
});
-
Sencha Premium Member
Just wanted to tell everyone that this fix seems to be also in ExtJs 5.1.2Thanks for that!TkDodo