mikecoj / MCDatepicker

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

How to highlight selected date on the calendar? #50

Closed A973C closed 3 years ago

A973C commented 3 years ago

I'm searching a way to highlight current day (done by default, ok) and user selected day (my question). The 'selectedDate' parameter seems to be the answer but I don't know what to do with it.

Could you help me, please?

ashenshugarRET commented 3 years ago

Hello,

Are you asking how do you set the selected date of a datepicker object through code, rather than having the user select a date?

If so the methods you want to use are setFullDate(), setDate(), setMonth() or setYear().

The documentation for this project should help you use these: https://mcdatepicker.netlify.app/docs/methods#setfulldate