I"¦(function() { var loadDatePicker, loadDatetimePicker, loadTimePicker, setDatePickerOptions, setPickerOptions; loadDatePicker = function() { return $("input.datepicker").each(function(i) { var defOpts; defOpts = { altFormat: "yy-mm-dd", altField: $(this).next(), changeYear: true, changeMonth: true }; return setDatePickerOptions(this, defOpts); }); }; loadTimePicker = function() { return $("input.timepicker").each(function(i) { var defOpts; defOpts = { timeOnly: true, altField: $(this).next(), altFieldTimeOnly: false, defaultValue: this.value }; return setPickerOptions(this, defOpts); }); }; loadDatetimePicker = function() { return $("input.datetimepicker").each(function(i) { var defOpts; defOpts = { altField: $(this).next(), altFieldTimeOnly: false, altFormat: "yy-mm-dd", altTimeFormat: "HH:mm" }; return setPickerOptions(this, defOpts); }); }; Window.bindHDPickers = function() { loadDatePicker(); loadTimePicker(); return loadDatetimePicker(); }; $(document).on('ready page:load', function() { return Window.bindHDPickers(); }); setPickerOptions = function(input, defOpts) { var allOpts, userOpts; userOpts = $(input).data(); allOpts = $.extend({}, defOpts, userOpts); return $(input).datetimepicker(allOpts); }; setDatePickerOptions = function(input, defOpts) { var allOpts, userOpts; userOpts = $(input).data(); allOpts = $.extend({}, defOpts, userOpts); return $(input).datepicker(allOpts); }; }).call(this); :ET