lib/jqr-helpers/helpers.rb in jqr-helpers-1.0.31 vs lib/jqr-helpers/helpers.rb in jqr-helpers-1.0.32
- old
+ new
@@ -288,10 +288,10 @@
# @param options [Hash] options to be passed to datepicker().
# @param html_options [Hash] options to be passed to text_field_tag.
# @return [String]
def date_picker_tag(name, value=Date.today, options={}, html_options={})
format = options.delete(:format) || '%Y-%m-%d'
- value = value.strftime(format)
+ value = value.strftime(format) if value.present?
options[:dateFormat] = _map_date(format)
html_options[:'data-date-options'] = options.to_json
html_options[:class] ||= ''
html_options[:class] << ' ujs-date-picker'
text_field_tag(name, value, html_options)