pickadate.js
pickadate.js copied to clipboard
Cannot read property 'set' of undefined
I'm trying to edit the min value of an existing picker on my page. I'm using
$('#FromDate').pickadate('picker').set('min', true);
$('#ToDate').pickadate('picker').set('min',true);
When putting the code in my document.ready I get the following error Cannot read property 'set' of undefined
Placing the code in an $(window).on('load', function ()) works, but then the changes are not always applied to the datepicker Q.Q.
What am I missing here?
Placing the code in an $(window).on('load', function ())
Well, the code and libraries are initialized after documentready so this is expected and normal.
So what is the right approach for setting a value once the pickadate has been initialised if not tin the $(document).ready(function() {));
block?