Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mikecoj/MCDatepicker

A vanilla JavaScript Datepicker
https://github.com/mikecoj/MCDatepicker

datepicker vanilla-javascript-datepicker

Last synced: about 1 month ago
JSON representation

A vanilla JavaScript Datepicker

Awesome Lists containing this project

README

        

# MCDatepicker

Framework-agnostic, highly-customizable Vanilla JavaScript datepicker with zero dependencies.

### Features

- 2 Modes: (modal, inline)
- Dependency free
- Custom weekday and month names
- Disable weekdays and specific dates
- Fully responsive/ Mobile friendly

## Installation

#### Via NPM

```
npm install mc-datepicker --save
```

#### Using CDN

Include CDN links in the ``...

```html

```

## Usage

```html

```

If you’re using a bundler, e.g. webpack, you’ll need to import ` MCDatepicker`

```javascript
import MCDatepicker from 'mc-datepicker';
```

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

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

2. Customize the datepicker by adding more options

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

3. Use methods to manipulate the datepicker

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

## Documentation

[Online Docs](https://mcdatepicker.netlify.app/docs/)

## License

[MIT](LICENSE)