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