extjsextjs4extjs5sencha-architect

Strange behavior of Ext.Date.add component


I have a problem with

Ext.Date.add

When I add days:

var someDate = new Date(2021, 9, 30);
var startDate = Ext.Date.add(someDate, Ext.Date.DAY,  1);
var endDate = Ext.Date.add(someDate, Ext.Date.DAY,  2);

the values start and end are the same. Why this happens?


Solution

  • I just added true and now everything works fine:

    var startDate = Ext.Date.add(someDate, Ext.Date.DAY,  1, true);
    var endDate = Ext.Date.add(someDate, Ext.Date.DAY,  2, true);