Details
-
Type:
Improvement
-
Status: Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.8.2-EE-GA_P02, 2.0.0, 2.0.1
-
Fix Version/s: None
-
Component/s: ICE-Components
-
Labels:None
-
Environment:All
Description
Feature Request: Add an attribute(s) that would cause the selectInputDate to only render or allow dates that are in the future or past of the current date. Currently the only way to restrict these sets of dates is to use a validator and then throw a validation error if a user selects an incorrect date.
Possible attribute names:
- disableFutureDates, disablePastDates
- allowFutureDatesOnly, allowPastDatesOnly
Possible attribute names:
- disableFutureDates, disablePastDates
- allowFutureDatesOnly, allowPastDatesOnly
Additional requests from customer:
The described requirement fits our needs allmost. However, to make it a little bit smarter, I would recommend to make it numerically allowing to define the offset of days in the future or in the past.
eg.
-futureDaysStart="0" means from today on
-futureDaysStart="1" means from tomorrow on
-pastDaysStart="1" means up until yesterday
....
This way one could get a smarter behaviour and the date could be calculated on server side. In our case, if it is before 12:00 lunch time, today must be possible. But after 12:00 dates only from tomorrow on should be selectable. By having the value evaluated by a EL statement it could then calculate on the fly from when on (ur until when) the dates should be enabled.
As well it would be interesting to limit the time up until when dates could be choosen in the past or the future. By combining all this, there could be defined this way a time window where the user could choose a date.
eg. the following means to have dates possible from tomorrow up until 10 days from now.
-futureDaysStart="1"
-futureDaysEnd="10"