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

https://github.com/jenkinsci/flatpickr-api-plugin


https://github.com/jenkinsci/flatpickr-api-plugin

jenkins-api-plugin

Last synced: about 1 year ago
JSON representation

Awesome Lists containing this project

README

          

# flatpickr API plugin

This plugin exposes [flatpickr.js](https://flatpickr.js.org/) for use in Jenkins plugins.
The included styling supports dark theme out of the box.

## Usage

To load the flatpickr.js library add the following to your jelly:
```xml

```

## Sample

In your jelly create a div that contains an input field and a button. Set the attribute `data-input` on the input field and
the attribute `data-toggle` on the button.
```xml






```

In javascript attach flatpickr to the div, e.g with
```js
Behaviour.specify(".flatpickr-input", "flatpickr-input", 0, function(fp) {
flatpickr(fp, {
allowInput: true,
enableTime: true,
wrap: true,
clickOpens: false,
dateFormat: "Y-m-d H:i",
time_24hr: true,
static: true,
minDate: fp.dataset.now,
});
});
```
Set the option `wrap: true` with above sample.

Clicking on the button will now open/close the date-time-picker

## LICENSE

Licensed under MIT, see [LICENSE](LICENSE.md)