Class: TwitterCldr::Localized::LocalizedTime
Instance Attribute Summary
#calendar_type, #timezone
#base_obj, #formatter, #locale
Instance Method Summary
collapse
#additional_formats, #ago, #initialize, #to_additional_s, #to_s, #to_timespan, types, #until, #with_timezone
#initialize, localize
Instance Method Details
#gmtime ⇒ Object
24
25
26
|
# File 'lib/twitter_cldr/localized/localized_time.rb', line 24
def gmtime
LocalizedTime.new(@base_obj.gmtime, @locale, chain_params)
end
|
#localtime ⇒ Object
28
29
30
|
# File 'lib/twitter_cldr/localized/localized_time.rb', line 28
def localtime
LocalizedTime.new(@base_obj.localtime, @locale, chain_params)
end
|
#to_date ⇒ Object
20
21
22
|
# File 'lib/twitter_cldr/localized/localized_time.rb', line 20
def to_date
LocalizedDate.new(@base_obj, @locale, chain_params)
end
|
#to_datetime(date) ⇒ Object
10
11
12
13
14
|
# File 'lib/twitter_cldr/localized/localized_time.rb', line 10
def to_datetime(date)
date_obj = date.is_a?(LocalizedDate) ? date.base_obj : date
dt = DateTime.parse("#{date_obj.strftime("%Y-%m-%d")}T#{@base_obj.strftime("%H:%M:%S%z")}")
LocalizedDateTime.new(dt, @locale, chain_params)
end
|
#to_time(base_time = Time.now) ⇒ Object
16
17
18
|
# File 'lib/twitter_cldr/localized/localized_time.rb', line 16
def to_time(base_time = Time.now)
self
end
|