Search code examples
javascripttwitter-bootstrapdatepickerbootstrap-datepickerbootstrap-datetimepicker

How to stop datetimepicker setting todays date in textbox by default onclick


When we select calendar icon, it automatically sets today's date to textbox. Is there any parameter/option in the datetimepicker() function which can be set to false or null preventing datetimepicker() setting today date to textbox by default. If someone doesn't select any date from calendar the textbox should be empty rather than having today's date set by datetimepicker().


Solution

  • Worth reading the docs. Change the useCurrent attribute when initailizing the datetimepicker.

    https://eonasdan.github.io/bootstrap-datetimepicker/Options/#usecurrent