https://github.com/jcsmorais/shortcut-buttons-flatpickr
Flatpickr's plugin that provides users an alternative way to interact with the datetime picker.
https://github.com/jcsmorais/shortcut-buttons-flatpickr
buttons calendar flatpickr javascript plugin shortcut
Last synced: 5 months ago
JSON representation
Flatpickr's plugin that provides users an alternative way to interact with the datetime picker.
- Host: GitHub
- URL: https://github.com/jcsmorais/shortcut-buttons-flatpickr
- Owner: jcsmorais
- License: mit
- Created: 2018-04-23T05:49:30.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-09-11T06:14:29.000Z (about 2 years ago)
- Last Synced: 2025-04-22T17:14:41.814Z (6 months ago)
- Topics: buttons, calendar, flatpickr, javascript, plugin, shortcut
- Language: TypeScript
- Homepage:
- Size: 990 KB
- Stars: 26
- Watchers: 3
- Forks: 14
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Shortcut buttons
[](https://circleci.com/gh/jcsmorais/shortcut-buttons-flatpickr/tree/master)
[](https://coveralls.io/github/jcsmorais/shortcut-buttons-flatpickr?branch=master)
[](https://badge.fury.io/js/shortcut-buttons-flatpickr)
[](https://flatpickr.js.org/)
[](https://raw.githubusercontent.com/jcsmorais/shortcut-buttons-flatpickr/master/LICENSE)
[](https://www.jsdelivr.com/package/npm/shortcut-buttons-flatpickr)Shortcut buttons is a plugin for [flatpickr](https://flatpickr.js.org/) that provides users an alternative way to interact with the datetime picker.





# Motivation
Shortcut buttons development has been motivated by the need of having a fast, flexible and seemless alternative way for users to select specific date(s) without being forced to navigate through their calendars and individually select those date(s).# Installation
Installing as a module:
```bash
yarn add shortcut-buttons-flatpickr
```Installing on non-module environments:
```html```
# API
| Params | Type | Description |
|-----------------------|--------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `button` | `Object`, `Object[]` | Button(s). |
| `[button.attributes]` | `Object` | Button's attributes.
Supported attributes: `accesskey`, `aria-label`, `class` and `tabindex`. |
| `button.label` | `string` | Button's label. |
| `[label]` | `string` | Label including a word/sentence stating that the user can use the calendar or one of the buttons. |
| `onClick` | `Function`, `Function[]` | Callback(s) invoked when plugin's buttons are clicked. Each callback is fed with two parameters:
`index` - the index of the clicked button.
`fp` - flatpickr's instance. |
| `[theme]` | `string` | Flatpickr's theme, defaults to `light` if none supplied. |# Usage Examples
* [Beginning Of Time](http://bit.ly/2jjcQK0)
* [Clear Date Selection](http://bit.ly/2wrPyYp)
* [Quick Month Selection](http://bit.ly/2KdleFS)
* [US Holidays Navigator](http://bit.ly/2raWK9D)
* [Yesterday, Today and Tomorrow](http://bit.ly/2KrWMC0)