Jump to content
We've recently updated our Privacy Statement, available here ×

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


girish.gandhi

Recommended Posts

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.

pastedImage_1.png

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...