pickadate default date


Topic: pickadate default date

robshelby pro premium priority asked 4 years ago

How do I set the default date in pickadate?

$('.datepicker').pickadate({ min: new Date(1910, 1, 1), max: new Date(), defaultDate:new Date(1975,1,1), selectYears: 100, formatSubmit: 'mm/dd/yyyy', })

defaultDate doesn't seem to do anything.

I should mention that I realize I could do something like .val("1/1/2015").change(); ... But when you click on the input to change the date, the day/month/year selectors are still on today's date. Those selectors should also be on Jan, 1st, 2015.

Thanks!


Krzysztof Wilk staff answered 4 years ago

Hi!

I think this snippet should resolve your problem https://mdbootstrap.com/snippets/jquery/bartek-malanowski/242678#html-tab-view :)

Best regards


robshelby pro premium priority commented 4 years ago

This doesn't seem to do anything to me. Are you sure this works with 4.8.11?


Krzysztof Wilk staff commented 4 years ago

Hi!

It works for me, check it here: https://mdbootstrap.com/snippets/jquery/krzysztof-wilk/2592932#js-tab-view. If it still doesn't work for you - just remove the "data-value" attribute from the HTML section and uncomment JavaScript code. It's simple one but it works :)

Best regards


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: 4.8.11
  • Device: windows
  • Browser: chrome
  • OS: windows
  • Provided sample code: No
  • Provided link: No