In Buddhist Era calendar it's already 2555 year. What is the easiest way to make Date.current show 2555 instead of 2012?
UPDATE
I've found solution for this particular task. It can be easily implemented with just standard rails i18n.
cat config/locales/th.rb
{
th: {
date: {
formats: {
default: lambda { |date, _| "%d.%m.#{date.year + 543}" }
}
}
}
}
and then just use I18n.l method:
ruby-1.9.3-p194 :032 > I18n.l(Date.current)
=> "30.10.2555"
This might be what you're looking for.
https://github.com/ai/r18n
R18n.set('th')
R18n.l Time.now, :full #=> "1 พฤศจิกายน, 2554 12:00"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With