A simple issue, but I can't seem to find the answer.
I've limited the date range in jQuery Datepicker:
$( "#MyDatepicker" ).datepicker( "option", "minDate", new Date())
Is there a way to remove all restrictions for date range?
If you like to restrict access of users to select a date within a range then there is minDate and maxDate options are available in jQuery UI. Using this you can set the date range of the Datepicker. After defining these options the other days will be disabled which are not in a defined range.
By default DatePicker has standard height and width (height: '30px' and width: '143px'). You can change this height and width by using height and width property respectively.
You can restrict the users from selecting a date within the particular range by specifying MinDate and MaxDate properties. The default value of MinDate property is 1/1/1920 and MaxDate property is 12/31/2120 . Dates that appears outside the minimum and maximum date range will be disabled (blackout).
To implement this, write code in jQuery UI Datepicker "onSelect" event which gets called when date is selected. $(document). ready(function () { var daysToAdd = 4; $("#txtFromDate"). datepicker({ onSelect: function (selected) { var dtMax = new Date(selected); dtMax.
Try this $( "#MyDatepicker" ).datepicker( "option", "minDate", null)
.
From JQuery documentation about datepicker minDate option
Set a minimum selectable date via a Date object or as a string in the current dateFormat, or a number of days from today (e.g. +7) or a string of values and periods ('y' for years, 'm' for months, 'w' for weeks, 'd' for days, e.g. '-1y -1m'), or null for no limit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With