class RailsAdmin::Support::Datetime
Public Class Methods
delocalize(date_string, format)
click to toggle source
# File lib/russian/rails_admin_datetime.rb, line 6 def delocalize(date_string, format) ret = date_string if I18n.locale == :ru format.to_s.scan(/%[AaBbp]/) do |match| case match when '%B' english = I18n.t('date.month_names', :locale => :en)[1..-1] common_month_names = I18n.t('date.common_month_names')[1..-1] common_month_names.each_with_index {|m, i| ret = ret.gsub(/#{m}/i, english[i]) } unless ret.blank? when '%b' english = I18n.t('date.abbr_month_names', :locale => :en)[1..-1] common_abbr_month_names = I18n.t('date.common_abbr_month_names')[1..-1] common_abbr_month_names.each_with_index {|m, i| ret = ret.gsub(/#{m}/i, english[i]) } unless ret.blank? end end end ret = delocalize_without_russian(ret, format) ret end
Also aliased as: delocalize_without_russian