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
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().
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.
DateItem.setDefaultProperties() is the equivalent of SmartClient’s addProperties().
Example of increase DateItem End Year
Which property do I set to increase the default end year which is currently 2020?
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:
DateItem didef= new DateItem();
Date d = DateUtil.parseInput("12/31/2050", "MM/DD/YYYY");
didef.setEndDate(d);
DateItem.setDefaultProperties(didef);
As wel as:
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
Also use DateChooser.setDefaultProperties() to setEndYear(newYear).
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:
DateChooser defaultProperties = new DateChooser();
defaultProperties.setEndYear(2050);
DateChooser.setDefaultProperties(defaultProperties);
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).
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.