Uploaded image for project: 'ZK Calendar'
  1. ZK Calendar
  2. ZKCAL-105

calendarsMonth use new Date() instead of current date when drawing from mold

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 3.1.2
    • 3.1.0, 3.1.1
    • Security Level: Jimmy
    • None

      Steps to Reproduce

      Run calendar demo

      https://www.zkoss.org/zkdemo/zk_calendar/zk_calendar

      switch to week calendar

      use the previous week arrow to navigate until the previous month (if starts in September, scroll until august)

      switch calendar to month mold

      Current Result

      out-of-month cell style is applied to every cell except the last few shared between displayed month and current real-time month

      Expected Result

      only cells outside of currently displayed month should be greyed out

      Debug Information

      when drawing from mold, mold assume that current month is real-time current month.

      This is correct during initial rendering, but not if a different month is selected, or if the calendar was moved around in week or day mode beforehand

      Workaround

      attached replacement files for calendarsMonth mold.

      Deploy by adding these files under the directory

      /src/main/resources/web/js/calendar/mold/calendarsMonth.js

      /src/main/resources/web/js/calendar/mold/calendarsMonth.src.js

      2023/09/20 UPDATED WORKAROUND

      workaround was causing current day to be marked as the current date on every month when switching back to month view

      2023/09/22 UPDATED WORKAROUND

      Workaround was causing Today to also appear on different month is matching activeDate

      Differentiated between today and active date in rendering

       

        1. bug calendar.PNG
          bug calendar.PNG
          44 kB
        2. calendarsMonth.js
          5 kB
        3. calendarsMonth.src.js
          5 kB

            MDuchemin MDuchemin
            MDuchemin MDuchemin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: