How to Restrict Input Control of datatype date for not showing future dates

Hi Team,

I have created a report in cabi jasper report server which displays the results by filtering data within a selected period range. I am using the two input controls of type date so that the user can select the period beginning and period end date. The problem i am facing is that the calendar is displaying future dates too. I want to restrict the calendar to the present date only. However, if we can't restrict it , can we validate the input control to pop up an error immediately if the user selects the date greater then the present date or some pop up error message if the user selects start date greater than the end date. Can anyone help me on this ?

Thanks in Advance.

girish.gandhi's picture
Joined: Oct 24 2018 - 2:34am
Last seen: 3 years 6 months ago

1 Answer:

In 7.1 version you can browse to /scripts/bower_components/jquery-ui/ui/jquery.ui.datepicker.js file.

You can explore options with below lines

yearRange: "c-10:c+10", // Range of years to display in drop-down,
            // either relative to today's year (-nn:+nn), relative to currently displayed year
            // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)

sthomas_3's picture
Joined: Dec 15 2014 - 2:56pm
Last seen: 3 years 10 months ago