Skip to content

YuaFox/easepick2

 
 

Repository files navigation

easepick2

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.

Installation

npm install @yuafox/easepick2

Basic Usage

import { 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',
});

viewMode Option

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.

Using with Plugins

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(),
  },
});

Available Plugins

  • 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

Packages

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

License

GPL-2.0-or-later

About

Date range picker. Uses Shadow DOM, lightweight size, no dependencies.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 84.7%
  • SCSS 11.8%
  • JavaScript 2.0%
  • Shell 1.5%