Announcement

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

    Dateitem.endDate value is too close to current date

    As we can see in the documentation, the default value for endDate is currently 12/31/2015 and that is too close to the current day. I would like to suggest that it changes to something further in the future (ex: 12/31/2020 or later).

    http://www.smartclient.com/docs/9.1/a/b/c/go.html#attr..DateItem.endDate

    #2
    We've updated the defaults so that DateItems and DateChoosersto cover dates from 1995 - 2020. Please retest with a build dated March 13 or later.

    You can change these defaults globally if you want, via isc.DateItem/DateChooser.addProperties().

    Comment


      #3
      Example of increase DateItem End Year

      Can you post an example for smartGwt code how to set the DateItem's year globally to higher than 2020 please.

      Comment


        #4
        DateItem.setDefaultProperties() is the equivalent of SmartClient's addProperties().

        Comment


          #5
          Example of increase DateItem End Year

          Which property do I set to increase the default end year which is currently 2020?

          Comment


            #6
            ListGrid DateItem

            I have a ListGrid that has a Date column and I am trying to increase the max end date for the DateChooser that the ListGrid shows in the Editor from 2020 to something higher. I have tried using:

            Code:
            DateItem didef= new DateItem();
            Date d = DateUtil.parseInput("12/31/2050", "MM/DD/YYYY");		
            didef.setEndDate(d);
            DateItem.setDefaultProperties(didef);
            As wel as:

            Code:
            ListGridField li = new ListGridField(name, title);
            DateItem di = new DateItem();
            Date d = DateUtil.parseInput("12/31/2050", "MM/DD/YYYY");
            di.setEndDate(d);
            li.setEditorProperties(di);
            li.setType(ListGridFieldType.DATE);
            but neither approach seems to have any affect

            Comment


              #7
              Also use DateChooser.setDefaultProperties() to setEndYear(newYear).
              Last edited by Isomorphic; 11 Feb 2015, 21:32.

              Comment


                #8
                DateChooser Default doesn't seem to take for ListGrid Date Fields

                I have this also set but doesn't seem to have an effect on the ListGrid DateChooser, only DynamicForm items:

                Code:
                DateChooser defaultProperties = new DateChooser();
                defaultProperties.setEndYear(2050);
                DateChooser.setDefaultProperties(defaultProperties);

                Comment


                  #9
                  What version of SmartGWT are you using?

                  We just tested 4.1 and later and find that this code below works exactly as expected - all DateItems (whether in forms, or in a grid's editor or filterEditor) are updated to allow access upto year 2050 (you can open the DateChooser and then click the year in that widget to show the submenu).

                  Code:
                      	DateItem itemProps = new DateItem();
                      	itemProps.setEndDate(new Date(150, 11, 31));
                      	DateItem.setDefaultProperties(itemProps);
                  If this doesn't work for you, ensure you are running this code *before* any other code. If you think there's a framework issue here, please provide a complete and minimal stand-alone test-case we can run that shows the issue.
                  Last edited by Isomorphic; 12 Feb 2015, 12:39.

                  Comment

                  Working...
                  X