lib/timeliness/helpers.rb in timeliness-0.4.4 vs lib/timeliness/helpers.rb in timeliness-0.4.5
- old
+ new
@@ -21,10 +21,10 @@
year.to_i
end
def month_index(month)
return month.to_i if month.to_i > 0 || /0+/ =~ month
- month.length > 3 ? month_names.index(month.capitalize) : abbr_month_names.index(month.capitalize)
+ (month.length > 3 ? month_names : abbr_month_names).index { |str| month.casecmp?(str) }
end
def month_names
i18n_loaded? ? I18n.t('date.month_names') : Date::MONTHNAMES
end