Premium support for our pure JavaScript UI components


Post by gorakh.nath »

Hi Team,
I am always getting this error on change of date from today, forward or next.
My tbar config is:-

tbar = {
            [
              {
                type: 'combo',
                value: timelineView,
                editable: false,
                ref: 'viewPresetCombo',
                cls: 'select-view',
                listCls: 'list-items',
                listeners: { change: viewPresetHandler },
                items: getTimeLineViewList()
              },
              {
                type: 'dateField',
                editable: false,
                cls: 'date-field',
                onChange ({ value, userAction }) {
                  if(hasSchedulerInstance() && userAction) {
                    limitMonthRange(value);
                    const diff = DateHelper.diff(
                      DateHelper.clearTime(getSchedulerInstance().startDate),
                      value,
                      'days'
                    );
                    const updatedStartDate = DateHelper.add(
                      getSchedulerInstance().startDate,
                      diff,
                      'days'
                    );
                    getSchedulerInstance().startDate = updatedStartDate;
                    getSchedulerInstance().scrollToDate(value, {
                      block: getViewPosition()
                    });
                  }
                },
                listeners: {
                  trigger: onDatePickerLoad
                },
                ref: 'selectDate'
              },
              {
                type: 'button',
                text: 'L{todayText}',
                onClick () {
                  const today = DateHelper.clearTime(new Date());
                  if(hasSchedulerInstance() &&
                   !DateHelper.isEqual(today, getSchedulerInstance().startDate, 'days')) {
                    limitMonthRange(today);
                    const diff = DateHelper.diff(
                      DateHelper.clearTime(getSchedulerInstance().startDate),
                      today,
                      'days'
                    );
                    const updatedStartDate = DateHelper.add(
                      getSchedulerInstance().startDate,
                      diff,
                      'days'
                    );
                    getSchedulerInstance().startDate = updatedStartDate;
                    getSchedulerInstance().scrollToDate(today, {
                      block: getViewPosition()
                    });
                  }
                },
                cls: 'btn-today'
              },
              {
                type: 'button',
                icon: 'b-fa-angle-left',
                cls: 'btn-prev',
                onClick () {
                  if(hasSchedulerInstance()) {
                    getSchedulerInstance().shiftPrevious();
                  }
                }
              },
              {
                type: 'button',
                icon: 'b-fa-angle-right',
                cls: 'btn-next',
                onClick () {
                  if(hasSchedulerInstance()) {
                    getSchedulerInstance().shiftNext();
                  }
                }
              },
              '->'
            ]
          }

Now if I click 'btn-next', 'btn-prev' and today or any other combination like next today, prev then the above error is coming.I have attached the screenshot fo the reference.

Attachments
Screenshot 2021-10-19 at 12.47.17 PM.png
Screenshot 2021-10-19 at 12.47.17 PM.png (582.16 KiB) Viewed 1462 times

Post by mats »

We could not reproduce this issue. To assist you with your question, please provide more details including a runnable test case (as described in our support guidelines).

To get the fastest possible support, provide a simple test case based on our standard examples.


Post Reply