bootstrap datepicker not disabled previous dates

omer khan

i am using bootstrap datepicker and i want to disabled previous dates but nothing will work.

this is what i tried so far

<input type="text" name="a" class="datepicker form-control"/>

$('.datepicker').datepicker({
    format: 'mm-dd-yyyy',
    minDate: new Date(),
    maxDate: '+1y'
});

////////

$('.datepicker').datepicker({
    format: 'mm-dd-yyyy',
    startDate: '05-18-2016'
});

but nothing will work.

Naqash Malik

Try this:

var nowTemp = new Date();
var now = new Date(nowTemp.getFullYear(), nowTemp.getMonth(), nowTemp.getDate(), 0, 0, 0, 0);

$('.datepicker').datepicker({
  onRender: function(date) {
    return date.valueOf() < now.valueOf() ? 'disabled' : '';
  }
});

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

bootstrap datepicker, beforeShowDay and array of disabled dates

From Dev

Disable previous dates in datepicker

From Dev

Android DatePicker : Previous dates are not disabled on my phone after installation but works PERFECTLY on the emulator

From Dev

Angular Bootstrap datepicker - date disabled

From Dev

Angular Bootstrap datepicker - date disabled

From Dev

Custom available dates bootstrap datepicker

From Dev

Custom available dates bootstrap datepicker

From Dev

clearing dates from bootstrap datepicker

From Dev

Bootstrap Datepicker show popover on dates

From Dev

Bootstrap Datepicker not showing dates correctly

From Dev

Bootstrap datepicker show dates only

From Dev

How to check whether a date is disabled or not in Bootstrap Datepicker?

From Dev

Angular bootstrap datepicker-popup with disabled input

From Dev

Customize specific disabled dates within a range using jQuery UI datepicker

From Dev

Make unavailable/undesirable dates disabled in jquery ui datepicker

From Dev

How to inactive previous date in Bootstrap datepicker?

From Dev

Bootstrap-datepicker uses previous value in popup

From Dev

Bootstrap datepicker configuration to block specific dates (holidays)

From Dev

Bootstrap DatePicker disable many dates using onRender

From Dev

Bootstrap Datepicker restrict available dates to be selected

From Dev

Bootstrap Datepicker 2.0 To select multiple dates

From Dev

Bootstrap datepicker modify to take two dates

From Dev

bootstrap3 multiple dates in inline datepicker

From Dev

Bootstrap3 Datepicker - Count Active dates

From Dev

Bootstrap DatePicker - Skip array of dates in range

From Dev

Bootstrap Datepicker return colour for select dates

From Dev

disable all previous dates in angular bootstrap datetimepicker

From Dev

disable all previous dates in angular bootstrap datetimepicker

From Dev

Disable previous dates of a datepicker according to selected date in javascript or jquery

Related Related

  1. 1

    bootstrap datepicker, beforeShowDay and array of disabled dates

  2. 2

    Disable previous dates in datepicker

  3. 3

    Android DatePicker : Previous dates are not disabled on my phone after installation but works PERFECTLY on the emulator

  4. 4

    Angular Bootstrap datepicker - date disabled

  5. 5

    Angular Bootstrap datepicker - date disabled

  6. 6

    Custom available dates bootstrap datepicker

  7. 7

    Custom available dates bootstrap datepicker

  8. 8

    clearing dates from bootstrap datepicker

  9. 9

    Bootstrap Datepicker show popover on dates

  10. 10

    Bootstrap Datepicker not showing dates correctly

  11. 11

    Bootstrap datepicker show dates only

  12. 12

    How to check whether a date is disabled or not in Bootstrap Datepicker?

  13. 13

    Angular bootstrap datepicker-popup with disabled input

  14. 14

    Customize specific disabled dates within a range using jQuery UI datepicker

  15. 15

    Make unavailable/undesirable dates disabled in jquery ui datepicker

  16. 16

    How to inactive previous date in Bootstrap datepicker?

  17. 17

    Bootstrap-datepicker uses previous value in popup

  18. 18

    Bootstrap datepicker configuration to block specific dates (holidays)

  19. 19

    Bootstrap DatePicker disable many dates using onRender

  20. 20

    Bootstrap Datepicker restrict available dates to be selected

  21. 21

    Bootstrap Datepicker 2.0 To select multiple dates

  22. 22

    Bootstrap datepicker modify to take two dates

  23. 23

    bootstrap3 multiple dates in inline datepicker

  24. 24

    Bootstrap3 Datepicker - Count Active dates

  25. 25

    Bootstrap DatePicker - Skip array of dates in range

  26. 26

    Bootstrap Datepicker return colour for select dates

  27. 27

    disable all previous dates in angular bootstrap datetimepicker

  28. 28

    disable all previous dates in angular bootstrap datetimepicker

  29. 29

    Disable previous dates of a datepicker according to selected date in javascript or jquery

HotTag

Archive