Module: DateUtil::Localize

Included in:
SimpleForm::Inputs::UiDatePickerInput
Defined in:
lib/date_util/localize.rb

Instance Method Summary collapse

Instance Method Details

#localized(value) ⇒ Object



5
6
7
# File 'lib/date_util/localize.rb', line 5

def localized value
  value
end

#to_english_date(date_string, country_code = :sv) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/date_util/localize.rb', line 9

def to_english_date(date_string, country_code = :sv)
  case country_code.to_sym
  when :sv
    date_string.gsub(/may|okt/, 'may' => 'May', 'okt' => 'Oct')
  else
    raise ArgumentError, "Country code #{sw} not currently supported, please extend DateUtil::Localize"
  end
end