update
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
// npm package: flatpickr
|
||||
// github link: https://github.com/flatpickr/flatpickr
|
||||
|
||||
'use strict';
|
||||
|
||||
(function () {
|
||||
|
||||
// date picker
|
||||
const flatpickrDateEl = document.querySelector('#flatpickr-date');
|
||||
if(flatpickrDateEl) {
|
||||
flatpickr("#flatpickr-date", {
|
||||
wrap: true,
|
||||
dateFormat: "Y-m-d",
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// time picker
|
||||
const flatpickrTimeEl = document.querySelector('#flatpickr-time');
|
||||
if(flatpickrTimeEl) {
|
||||
flatpickr("#flatpickr-time", {
|
||||
wrap: true,
|
||||
enableTime: true,
|
||||
noCalendar: true,
|
||||
dateFormat: "H:i",
|
||||
});
|
||||
}
|
||||
|
||||
})();
|
||||
Reference in New Issue
Block a user