Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Problem in Calendar with dateIsWorkday function

    If I define a Calendar with this dateIsWorkday function:

    dateIsWorkday: function (date) {
    var today = new Date();
    if (today.getFullYear() === date.getFullYear() && today.getMonth() === date.getMonth() && today.getDate() === date.getDate() && date.getHours() > 14 && date.getHours() < 17) {
    return false;
    } else {
    return true;
    }
    }

    I expect to see with a different style the hours between 14 and 17 of just today.

    This works ok in day view.
    If I switch to week view, I see ok for today the proper style in today cell. The problem is if I move to the next week. The same cells remains with the same style than before (that's wrong), but if I move the mouse over them, it becomes fixed.

    I have tried also the Calendar.weekView.refreshStyle but it doesn't work neither (in dayView works ok).

    So two issues here:
    * The style is not refreshed when switching week
    * The style is not refreshed if I even force a manually weekView.refreshStyle()

    Thanks.
    Last edited by martintaal; 20 Mar 2013, 11:07.

    #2
    bumped up...

    gr. Martin

    Comment


      #3
      This is already assigned for investigation but we don't have anything to tell you yet.
      We'll let you know as soon as we have something for you

      Regards
      Isomorphic Software

      Comment


        #4
        Thanks for the report - we've fixed this in 8.3p and 9.0d - as of nightly builds dated March 20, you should see this work as expected in Day and Week views and you should just remove any refresh code you've added to work around the bug.

        Comment


          #5
          I have tried your 8.3p 20 March, and the issue remains exactly in the same way.

          In your explorer is difficult to notice, since you don't have any difference between your "calendar" and "calendarWorkday" css classes.

          If you put in the sources:

          .calendarWorkday {
          background-color: pink;
          }

          and then go to

          http://vmkubuntu:8080/isomorphic/system/reference/SmartClient_Explorer.html#simpleCalendar

          and put the following code in the "simpleCalendar.js" tab:

          Code:
          isc.Calendar.create({
            ID: "eventCalendar", 
            scrollToWorkday: true,
            showWorkday: true,
            workdayStart: '09:00',
            workdayEnd: '19:00',
            dateIsWorkday: function (date) {
              var today = new Date();
              if (today.getFullYear() === date.getFullYear() && today.getMonth() === date.getMonth() && today.getDate() === date.getDate() && date.getHours() > 14 && date.getHours() < 17) {
                return false;
              } else {
                return true;
              }
            },
            data: eventData
          });
          you will see that in current day (IN WEEK VIEW) you will see a white rows today between 14:00 and 17:00 (that's ok), but if you move to the previous or to the next week, the white rows are stille there until you move mouse over them.

          Regards.

          Comment


            #6
            This has been addressed in 8.3 and 9.0 in builds dated March 22 and later

            Comment


              #7
              I have tried your 8.3p 22 March, and the issue remains exactly in the same way.

              If you do the steps of two posts above, you can reproduce it easily

              Comment


                #8
                Apologies, we didn't fully port the fix to 8.3 - it's there now and will hit tomorrow's build.

                Comment

                Working...
                X