lib/timeliness/helpers.rb in timeliness-0.3.4 vs lib/timeliness/helpers.rb in timeliness-0.3.5
- old
+ new
@@ -20,10 +20,10 @@
end
year.to_i
end
def month_index(month)
- return month.to_i if month.to_i > 0
+ return Integer(month) rescue ArgumentError
month.length > 3 ? month_names.index(month.capitalize) : abbr_month_names.index(month.capitalize)
end
def month_names
i18n_loaded? ? I18n.t('date.month_names') : Date::MONTHNAMES