mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 01:47:18 +02:00
Improve date picker UI
- Set first day of week to Monday - Enable year and month selectors #590
This commit is contained in:
parent
513a729673
commit
1ed10d2237
6 changed files with 24 additions and 11 deletions
21
app/assets/javascripts/datepicker.js
Normal file
21
app/assets/javascripts/datepicker.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
(function () {
|
||||
$.datepicker.setDefaults({
|
||||
changeMonth: true,
|
||||
changeYear: true,
|
||||
duration: 'fast',
|
||||
firstDay: 1, // Monday
|
||||
dateFormat: 'yy-mm-dd',
|
||||
});
|
||||
|
||||
function attachDatePicker() {
|
||||
var dateFields = $('.datepicker');
|
||||
dateFields.datepicker();
|
||||
}
|
||||
|
||||
// For turbolinks
|
||||
document.addEventListener('page:change', function () {
|
||||
attachDatePicker();
|
||||
});
|
||||
|
||||
attachDatePicker();
|
||||
})();
|
Loading…
Add table
Add a link
Reference in a new issue