0

I have implemented datetimepicker as follows:

$('#txtStartDate').datetimepicker({ useCurrent: false, locale: _defaultCulture[0], format: 'L' });
$('#txtEndDate').datetimepicker({ useCurrent: false, locale: _defaultCulture[0], format: 'L' });

Can anyone tell how can I disable date before to current/today's date?

I read the documentation on http://eonasdan.github.io/bootstrap-datetimepicker/Options/#mindate, but not able to implement as it is.

VincenzoC
  • 30,117
  • 12
  • 90
  • 112
XamDev
  • 3,377
  • 12
  • 58
  • 97
  • 1
    Possible duplicate of [Set minDate to Today in Bootstrap DateTimePicker](http://stackoverflow.com/questions/27095415/set-mindate-to-today-in-bootstrap-datetimepicker) – VincenzoC Dec 06 '16 at 16:12

1 Answers1

1

Try the following in your JS

Include moment.js in your external js.(moment.js is must to use Eonasdan datetime picker).

As mentioned by @VincenzoC For more details follow the link

$(function() {
  $('#YourID').datetimepicker({
    format: 'L',
    useCurrent: false,
    minDate: moment()
  });

});

Fiddle

Raviteja
  • 3,399
  • 23
  • 42
  • 69
  • 1
    Please note that momentjs is [**required**](https://eonasdan.github.io/bootstrap-datetimepicker/Installing/) for eonasdan-datetimepicker, so you **have to** import it to make the component work. – VincenzoC Dec 06 '16 at 16:25
  • @Raviteja Thanks for the help ! That really helped ! – XamDev Dec 07 '16 at 03:45