Sha256: c0586c59567dfa7225ea0492336a901a5eae81117a2130b98e862cd0f3ef1eeb
Contents?: true
Size: 659 Bytes
Versions: 10
Compression:
Stored size: 659 Bytes
Contents
# encoding: UTF-8 # Copyright 2012 Twitter, Inc # http://www.apache.org/licenses/LICENSE-2.0 class Time def localize(locale = TwitterCldr.get_locale, options = {}) TwitterCldr::LocalizedTime.new(self, locale, options) end end module TwitterCldr class LocalizedTime < LocalizedDateTime def to_datetime(date) date_obj = date.is_a?(LocalizedDate) ? date.base_obj : date LocalizedDateTime.new(DateTime.parse("#{date_obj.strftime("%Y-%m-%d")}T#{@base_obj.strftime("%H:%M:%S%z")}"), @locale, :calendar_type => @calendar_type) end protected def formatter_const TwitterCldr::Formatters::TimeFormatter end end end
Version data entries
10 entries across 10 versions & 1 rubygems