williamtroup/Calendar.js

Some custom triggers not firing

Closed this issue · 2 comments

Describe the bug
A clear and concise description of what the bug is.
The onPreviousYear, onNextYear, and onSetDate custom triggers are not firing as expected when using those functions within the calendar. Fiddle example of basic calendar with custom triggers defined https://jsfiddle.net/mrussojr/u8mogrvk/.

To Reproduce
Steps to reproduce the behavior:

  1. Create basic calendar instance with options set for onSetDate, onNextYear, and onPreviousYear custom triggers that will log date to console
  2. Click on 'Jump to Date', enter date to jump to, and click 'Go'
  3. Click on 'View Full Year' button to show full year view
  4. Click on 'Next Year' button to go to next year and fire custom trigger
  5. Click on 'Previous Year' button to go to previous year and fire custom trigger
  6. View console to see that output is not there for any of the custom triggers

Expected behavior
Expected that the custom trigger defined in the option to fire, in the most basic example, to write output to the console.

Screenshots
No screenshots, but behavior is replicable in the fiddle above.

Desktop (please complete the following information):

  • OS: Windows 10, v22H2, build 19045.3930
  • Browser: Chrome v121.0.6167.161 (64-bit), Edge v121.0.2277.112 (64-bit)

Step 2 is an issue, and will be fixed in the next release. As you are using a view, the other two will not get triggered, as the main date display is the Full Month view as not changed. This is going to be changed in v3.0.0 and the view date is unified.

v2.10.11 has been released, which fixes the Stp 2 issue you raised.