Permalink
Browse files

Bugfix for nil date.

  • Loading branch information...
1 parent 7c69488 commit 402055356f735c3ce85aa5b33d9d0ebe98209b37 @frisoft frisoft committed Jul 10, 2009
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/unobtrusive_date_picker.rb
@@ -104,7 +104,7 @@ def parse_divider_option(option)
def format_date_value_for_text_field(value, format, divider_option)
divider = DATEPICKER_DIVIDERS[parse_divider_option(divider_option)]
format_string = format.downcase.gsub(/(m|d)/, '%\1').gsub(/y/, '%Y').gsub('-', divider)
- value.strftime(format_string)
+ value.nil? ? '' : value.strftime(format_string)
end
def get_html_classes_for_datepicker(options, html_options_class, extra_class = nil)

0 comments on commit 4020553

Please sign in to comment.