Sha256: ec84a7ff9eb0c2a2b570b3a6f8b8ec55a279b483342e9d4c6448572f8114b4f9
Contents?: true
Size: 1.09 KB
Versions: 16
Compression:
Stored size: 1.09 KB
Contents
loadDatePicker = () -> $("input.datepicker").each (i) -> defOpts = { altFormat: "yy-mm-dd" altField: $(this).next() changeYear: true changeMonth: true} setDatePickerOptions( this, defOpts ) loadTimePicker = () -> $("input.timepicker").each (i) -> defOpts = {timeOnly: true altField: $(this).next() altFieldTimeOnly: false defaultValue: this.value} setPickerOptions( this, defOpts ) loadDatetimePicker = () -> $("input.datetimepicker").each (i) -> defOpts = {altField: $(this).next() altFieldTimeOnly: false altFormat: "yy-mm-dd" altTimeFormat: "HH:mm"} setPickerOptions( this, defOpts ) Window.bindHDPickers = () -> loadDatePicker() loadTimePicker() loadDatetimePicker() $(document).on 'ready page:load', -> Window.bindHDPickers() setPickerOptions = (input, defOpts) -> userOpts = $(input).data() allOpts = $.extend({}, defOpts, userOpts) $(input).datetimepicker(allOpts) setDatePickerOptions = (input, defOpts) -> userOpts = $(input).data() allOpts = $.extend({}, defOpts, userOpts) $(input).datepicker(allOpts)
Version data entries
16 entries across 16 versions & 1 rubygems