Announcement

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

    Can't select weekends in Calendar DateChooser

    Using SmartGWT 3.0 2012-11-01 LGPL.

    The DateChooser displayed in the top left-hand corner of the Calendar widget doesn't allow me to pick weekend days (Sat/Sun). This can also be seen in the show case here: http://www.smartclient.com/smartgwt/...endar_category

    Is this a bug or a missing setting?

    #2
    Probably because of this:
    http://www.smartclient.com/smartgwt/javadoc/com/smartgwt/client/widgets/calendar/Calendar.html#setWorkdays(int[])

    workdays - workdays Default value is [1,2,3,4,5]

    Comment


      #3
      Yes, I noticed this correlation, too. However, the work days set should only affect the calendar and not the DateChooser. If your assumption is correct I'd consider this a bug...

      Comment


        #4
        Turns out this has nothing to do with week days. If you set

        Code:
        calendar.setShowWeekends(Boolean.FALSE);
        Sat/Sun are removed from the DateChooser completely.

        I firmly consider this a bug now. A possible explanation for this behavior, however, could be deduced from the Javadoc of the setShowWeekends method:

        Suppresses the display of weekend days in the week and month views, and disallows the creation of events on weekends.
        Still, I don't think the two should be linked. I may want to select Sunday in the DateChooser even if I can't create new events on Sunday (think read-only calendars).
        Last edited by fhisg; 16 Nov 2012, 14:27.

        Comment


          #5
          The instructions tell us to ask here before creating a bug report. So, does this qualify for being a bug?

          Comment


            #6
            Hi,

            Did you try this ?
            Code:
            cal.setDisableWeekends(false);
            Phi

            Comment


              #7
              Originally posted by phi View Post
              Did you try this ?
              Code:
              cal.setDisableWeekends(false);
              That does work, true. However, I'm still unhappy about the fact that the behavior of the DateChooser is linked to the behavior of the week/month view. Note that if you set disableWeekends=false the weekends are no longer visually distinguishable in the week/month view. IMO it'd make a lot more sense to control these two settings individually.
              Since the the style is all inline and since the weekend days are not distinguishable in HTML from other days (like with a specific CSS class) I cannot easily override this with a custom style.
              Last edited by fhisg; 25 Nov 2012, 05:07.

              Comment

              Working...
              X