module Latias::Date::Formater

Public Instance Methods

buddhist_year(year) click to toggle source
# File lib/latias/date/formater.rb, line 10
def buddhist_year(year)
  year + 543
end
buddist_date_format(date, format: '%e %B %Y') click to toggle source
# File lib/latias/date/formater.rb, line 4
def buddist_date_format(date, format: '%e %B %Y')
  format = format.gsub('%Y', buddhist_year(date.year).to_s)
  format = format.gsub('%y', (buddhist_year(date.year) % 100).to_s)
  I18n.l(date, format: format, locale: :th)
end