Created
December 17, 2020 05:08
-
-
Save joeybeninghove/c5340af8001481d1a4c874ec337da5f5 to your computer and use it in GitHub Desktop.
simple_form + flatpickr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config.wrappers :flatpickr, class: 'mb-6 relative' do |b| | |
b.use :html5 | |
b.use :label, class: 'mb-2' | |
b.wrapper tag: :div, html: { | |
data: { | |
controller: 'flatpickr', | |
wrap: true, | |
alt_format: 'm/d/Y', | |
flatpickr_cleave_date_pattern: %w[m d Y] | |
} | |
} do |component| | |
component.use :input, class: 'w-full', placeholder: 'mm/dd/yyyy', data: { input: '' } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment