As a part of the newly released 2.0 version, we have implemeted an extension to the DateComboBox that lets you pick custom date ranges. We have also added the ability to define custom date ranges. By default, the grid ships with a number of default date ranges. These are listed below. You can customize which ranges appear by using configuration similar to this:

            <column  itemEditorApplyOnValueCommit="true"

                    id="date" dataField="addedDate" headerText="Date Added"

                    filterControl="DateComboBox" labelFunction="dataGridFormatDateLabelFunction"

filterDateRangeOptions="DATE_RANGE_THISQUARTER,DATE_RANGE_LASTQUARTER
,DATE_RANGE_THISYEAR,DATE_RANGE_LASTYEAR,DATE_RANGE_CUSTOM"/>

 

The two enhancements in 2.0 are the additoin of the Custom Date Range Picker, as well as the ability for you to define your own Date Ranges and register them. Below is the screenshot of the custom date range picker:

 


DATE_RANGE_CUSTOM 
DATE_RANGE_IN_THE_FUTURE 
DATE_RANGE_IN_THE_PAST 
DATE_RANGE_LAST_12_HOURS 
DATE_RANGE_LAST_24_HOURS 
DATE_RANGE_LAST_7_DAYS 
DATE_RANGE_LAST_SIXTY_MINTUES 
DATE_RANGE_LASTHOUR 
DATE_RANGE_LASTMONTH 
DATE_RANGE_LASTQUARTER 
DATE_RANGE_LASTWEEK 
DATE_RANGE_LASTYEAR 
DATE_RANGE_NEXTHOUR 
DATE_RANGE_NEXTMONTH 
DATE_RANGE_NEXTQUARTER 
DATE_RANGE_NEXTWEEK 
DATE_RANGE_NEXTYEAR 
DATE_RANGE_THISHOUR 
DATE_RANGE_THISMONTH 
DATE_RANGE_THISQUARTER 
DATE_RANGE_THISWEEK 
DATE_RANGE_THISYEAR 
DATE_RANGE_TODAY 
DATE_RANGE_TOMORROW 
DATE_RANGE_YESTERDAY 

 

 

CustomDateRangeExample.java (2.88 kb)