Date Picker: set default date using JS


Topic: Date Picker: set default date using JS

caliph007 pro asked 7 years ago

I am using the jQuery version and want to set a default date when initializing the datepicker. How can I do this?  

Mikołaj Smoleński staff answered 7 years ago

You can set the default date value by adding value atrribute to input: For example:
<input placeholder="Selected date" type="text" id="date-picker-example" value="12 January, 2018" class="form-control datepicker">
Regards

caliph007 pro commented 7 years ago

ok. Ist this here not possible? http://amsul.ca/pickadate.js/api/#method-set-select

Mikołaj Smoleński staff commented 7 years ago

You can try, but adding value attribute is faster and have the same effect

Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No