Skip to main content

Usage

In order to use MCDatepicker you need an <input /> tag, type of text

<input id="datepicker" type="text" />

If you’re using a bundler, e.g. webpack, you’ll need to add a SASS loader to webpack, and import MCDatepicker

import MCDatepicker from 'mc-datepicker';

1. Create a new instance, and attach it to an input tag#

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

2. Customize the datepicker by adding more options#

const picker = MCDatepicker.create({
el: '#datepicker',
disableWeekends: true
});

3. Use methods to manipulate the datepicker#

btn.onclick = () => picker.open();