A modern, lightweight date picker with day, month, and year view modes. Fork of the original easepick.
Originally created by Rinat G. (easepick). Forked and maintained by YuaFox.
npm install @yuafox/easepick2import { easepick } from '@yuafox/easepick2';
// Day picker (default)
const dayPicker = new easepick.create({
element: '#datepicker',
css: ['https://cdn.jsdelivr.net/npm/@yuafox/easepick2/dist/index.css'],
});
// Month picker
const monthPicker = new easepick.create({
element: '#monthpicker',
css: ['https://cdn.jsdelivr.net/npm/@yuafox/easepick2/dist/index.css'],
viewMode: 'month',
});
// Year picker
const yearPicker = new easepick.create({
element: '#yearpicker',
css: ['https://cdn.jsdelivr.net/npm/@yuafox/easepick2/dist/index.css'],
viewMode: 'year',
});| Value | Description |
|---|---|
'day' |
Default. Standard day-level calendar view. |
'month' |
Shows a 4x3 grid of months. Header navigates by year. |
'year' |
Shows a 4x3 grid of years. Header navigates by decade. |
All existing plugins work with all view modes:
import { easepick, RangePlugin, LockPlugin } from '@yuafox/easepick2';
const picker = new easepick.create({
element: '#datepicker',
css: ['https://cdn.jsdelivr.net/npm/@yuafox/easepick2/dist/index.css'],
viewMode: 'month',
plugins: [RangePlugin, LockPlugin],
RangePlugin: {
tooltip: false,
},
LockPlugin: {
minDate: new Date(),
},
});- RangePlugin — date/month/year range selection
- LockPlugin — disable specific dates/months/years
- PresetPlugin — predefined date ranges
- TimePlugin — time selection
- KbdPlugin — keyboard navigation
- AmpPlugin — additional month/year pickers
| Package | npm |
|---|---|
@yuafox/easepick2 |
Bundle (recommended) |
@yuafox/easepick2-core |
Core picker |
@yuafox/easepick2-datetime |
DateTime utility |
@yuafox/easepick2-base-plugin |
Base plugin class |
@yuafox/easepick2-range-plugin |
Range selection |
@yuafox/easepick2-lock-plugin |
Date locking |
@yuafox/easepick2-preset-plugin |
Preset ranges |
@yuafox/easepick2-time-plugin |
Time selection |
@yuafox/easepick2-kbd-plugin |
Keyboard navigation |
@yuafox/easepick2-amp-plugin |
AMP plugin |
GPL-2.0-or-later