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
- Host: GitHub
- URL: https://github.com/jenkinsci/flatpickr-api-plugin
- Owner: jenkinsci
- License: mit
- Created: 2024-05-31T21:44:04.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-21T21:26:53.000Z (over 1 year ago)
- Last Synced: 2025-03-21T22:26:45.357Z (over 1 year ago)
- Topics: jenkins-api-plugin
- Language: CSS
- Homepage: https://plugins.jenkins.io/flatpickr-api/
- Size: 28.3 KB
- Stars: 0
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
- Codeowners: .github/CODEOWNERS
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)