minDate and maxDate options are not working in datepicker

datepicker mindate today
datetimepicker maxdate
datetimepicker set mindate
datepicker mindate not working
datepicker maxdate today
how to set min date in datepicker using javascript
bootstrap datepicker mindate
set mindate and maxdate in datepicker

I'm using the "datepicker" plugin on my project, it's set to decade view, and I want to disable the future dates, for this I have used the maxDate option but it's not working, my code:

$('#data_1 .input-group.date').datepicker({
    todayBtn: "linked",
    maxDate: "0",
    keyboardNavigation: false,
    forceParse: false,
    calendarWeeks: true,
    autoclose: true
});

tried with 0 and new Date

Note that bootstrap-datepicker has no maxDate option, you have to use endDate.

Here a working sample:

$("#datepicker").datepicker({
  todayBtn: "linked",
  endDate: new Date(),
  keyboardNavigation: false,
  forceParse: false,
  calendarWeeks: true,
  autoclose: true
});
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.css" rel="stylesheet"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/css/bootstrap-datepicker3.css" rel="stylesheet"/>

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/js/bootstrap-datepicker.js"></script>

<input type="text" class="form-control" id="datepicker">

minDate/maxDate not working when passed via datepicker-options , When I use uib-datepicker-popup and pass minDate/maxDate as properties via datepicker-options I get this error: [$parse:lexerr] Lexer Error:  At 1.2.5 of UIBS min-date and max-date properties works perfect but at 1.3.3 this not work anymore and I'm trying with datepicker-options but is not working. I left a picture of the example, it is a simple date range between two date picker.

Try below code:

var today = new Date();  
$('#data_1 .input-group.date').datepicker({
            todayBtn: "linked",
            endDate: "today",
            maxDate: today
            keyboardNavigation: false,
            forceParse: false,
            calendarWeeks: true,
            autoclose: true
        });

Also you can try with:

 maxDate: 0

minDate and maxDate not working sugar datepicker, Hi All, I was trying this work around to restrict the dates in date picker using the minDate and maxDate options so that user can be. With jQuery UI it is easier to add Datepicker on the textbox element or in any other HTML elements. 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.

Adding attribute data-date-end-date="0d" worked for me:

<input type="text" id="birthDay" data-date-end-date="0d">

datePicker and minDate/maxDate/defaultDate/dateFormat not , I'm working on a template for WordPress that is utilizing jQuery UI's If I remove the minDate/maxDate options, today's date is displayed, but if I  Subject: Re: [cordova-plugin-datepicker] minDate and MaxDate not working I can confirm, min and maxdate won't work on Android, but on iOS. I use moment.js to generate a specific JS-Date-Object.

If u are trying calendar for start date and end date then this will help you :)

`$("#from").datepicker({
    format : 'dd-mm-yyyy',
    endDate: '<?php echo $to; ?>',
    changeMonth: false,
    changeYear: false,
    prevText: '<i class="fa fa-chevron-left"></i>',
    nextText: '<i class="fa fa-chevron-right"></i>',
    onClose: function (selectedDate) {
        $("#to").datepicker("option", "startDate", selectedDate);
    }
});
$("#to").datepicker({
    format : 'dd-mm-yyyy',
    startDate: '<?php echo $from; ?>',
    changeMonth: false,
    changeYear: false,
    prevText: '<i class="fa fa-chevron-left"></i>',
    nextText: '<i class="fa fa-chevron-right"></i>',
    onClose: function (selectedDate) {
        $("#from").datepicker("option", "endDate", selectedDate);
    }
});`

How to Set minimum and maximum date in jQuery UI Datepicker, With minDate and maxDate options, you can restrict date range of maximum possible date selection after that dates are not selectable in the  GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together. Sign up minDate/maxDate not working when passed via datepicker-options #5315

Min date option not working with jQuery UI datepicker [#2817693 , Adding a minimum date value to a date field such as "+1 day" works fine in Chrome's native datepicker but if the jQuery UI datepicker is used  Note I have two types of options herethose that go to datepicker (minDate, maxDate) and those that don't (tab_index). All are put into the html and minDate and maxDate are not added to datepicker. I was just trying to do something like this:

"DateTimePicker")., Returns the currently set moment of the options. TypeError - if minDate parameter is after options. maxDate or false if not set  If I only set dateOptions.minDate, without a maxDate value, then all the dates in the date-picker component are disabled. Also, if I set maxDate to a large value (to get the minDate options works), all the dates are also not selectable.

Datepicker Widget, Options. altField. altFormat. appendText. autoSize. beforeShow duration. firstDay. gotoCurrent. hideIfNoPrevNext. isRTL. maxDate. minDate This widget requires some functional CSS, otherwise it won't work. Creating a datepicker on an <input type="date"> is not supported due to a UI conflict with the native picker. I'm working on a template for WordPress that is utilizing jQuery UI's datePicker to display a calendar on the page. I'm having some problems. Initially

Comments
  • I try in the api's web: uxsolutions.github.io/bootstrap-datepicker ; if you put today at End date input its generate - endDate: "today" - so try to delete maxDate and add endDate: "today"
  • tried your solution not working, yes i tried with both "0" and "new date()", nothing seems to be working !!