Commit 0b71821045c3a6e06089e77c0656523bfb364f2f
1 parent
46549f70
Exists in
theme-brasil-digital-from-staging
and in
6 other branches
Fix datepicker date value
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
app/helpers/forms_helper.rb
... | ... | @@ -184,7 +184,7 @@ module FormsHelper |
184 | 184 | datepicker_options[:year_suffix] ||= '' |
185 | 185 | |
186 | 186 | element_id = html_options[:id] || 'datepicker-date' |
187 | - value_js_formatted = value.strftime('%Y-%m-%d %H:%S') | |
187 | + value_js_formatted = value.present? ? value.strftime('%Y-%m-%d %H:%S') : nil | |
188 | 188 | value = value.strftime(format) if value.present? |
189 | 189 | method = datepicker_options[:time] ? 'datetimepicker' : 'datepicker' |
190 | 190 | result = text_field_tag(name, value, html_options) | ... | ... |