mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
21 lines
463 B
JavaScript
21 lines
463 B
JavaScript
(function() {
|
|
$.datepicker.setDefaults({
|
|
changeMonth: true,
|
|
changeYear: true,
|
|
duration: 'fast',
|
|
firstDay: 1, // Monday
|
|
dateFormat: 'yy-mm-dd',
|
|
});
|
|
|
|
function attachDatePicker() {
|
|
let dateFields = $('.js-datepicker');
|
|
dateFields.datepicker();
|
|
}
|
|
|
|
// For turbolinks
|
|
document.addEventListener('page:change', function() {
|
|
attachDatePicker();
|
|
});
|
|
|
|
attachDatePicker();
|
|
})();
|