Announcement

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

    DateItem bad days

    Hi,

    I would like to configure the pop-up date picker that is attached to the DateItem widget to have the following characteristics:

    1) Show only weekdays (i.e. no weekends)
    2) Set minimum and maximum selectable dates
    3) Disable certain dates within the min/max range to account for bad days (e.g. market holidays)

    Currently I am achieving 1) using the following:
    Code:
            DateChooser dcProp = new DateChooser();
            dcProp.setDisableWeekends(true);
            dcProp.setShowWeekends(false);
            DateChooser.setDefaultProperties(dcProp);
    and 2) by:

    Code:
            DateItem valuationDate = new DateItem("valuationDate", "Date");
            valuationDate.setStartDate(startDate);
            valuationDate.setEndDate(endDate);
    Is there currently a way to accomplish 3) ?

    Thanks for your help.

    #2
    Hi, does anyone have an idea if this is even possible in SmartGWT?

    Comment


      #3
      Not really, you can have a validator to check for certain dates, but as far as disabling the user from actually selecting them, currently can't.

      Comment


        #4
        thanks for the reply. Do you think this is something that will be added to the library in the near future?

        Comment


          #5
          It has been asked before, but if I had to guess probably not in the neat future. You can always sponsor the feature: http://www.smartclient.com/services/index.jsp#features to get it on the roadmap quicker and meet your deadlines. It requires changes to the javascript code which actually isn't that hard, more creating the API to set dates that are disabled.

          Comment


            #6
            Thanks a lot for this post, helped me a lot.
            I was looking for a long time how to disable dates and also how to move calendar.

            So to allow users to move it around just add this code to the above example :
            Code:
            dcProp.setCanDragReposition(true);
            Also I would be very interested with ability to disable some specific dates (Holidays), possibly passing an array of dates to block.
            Thanks.

            Comment

            Working...
            X