Skip to content

Commit

Permalink
Bugfix for nil date.
Browse files Browse the repository at this point in the history
  • Loading branch information
frisoft committed Jul 10, 2009
1 parent 7c69488 commit 4020553
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/unobtrusive_date_picker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4020553

Please sign in to comment.