pickadate.js icon indicating copy to clipboard operation
pickadate.js copied to clipboard

Cannot read property 'set' of undefined

Open woeterman94 opened this issue 4 years ago • 2 comments

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?

woeterman94 avatar Apr 17 '20 09:04 woeterman94

Placing the code in an $(window).on('load', function ())

Well, the code and libraries are initialized after documentready so this is expected and normal.

DanielRuf avatar Apr 17 '20 13:04 DanielRuf

So what is the right approach for setting a value once the pickadate has been initialised if not tin the $(document).ready(function() {)); block?

xavierhb avatar May 14 '20 21:05 xavierhb