mikecoj / MCDatepicker

A vanilla JavaScript Datepicker
https://mcdatepicker.netlify.app/
MIT License
93 stars 18 forks source link

set full date not work. #91

Open RaptorII opened 1 year ago

RaptorII commented 1 year ago

the code from the documentation returns an error:

code: _const setFullDateBtn = document.querySelector('#setFullDateBtn');

const datepicker = MCDatepicker.create({ el: '#example' });

setFullDateBtn.onclick = () => { datepicker.setFullDate(new Date(2021, 1, 1)); };_

return error: Uncaught TypeError: Cannot read properties of undefined (reading 'setFullDate') at setFullDateBtn.onclick

mikecoj commented 1 year ago

Hi there! Make sure you have imported the resources correctly. It says the module is undefined which means it wasn't imported properly.