Class: TwitterCldr::LocalizedTime

Inherits:
LocalizedDateTime show all
Defined in:
lib/twitter_cldr/core_ext/calendars/time.rb

Instance Attribute Summary

Attributes inherited from LocalizedDateTime

#calendar_type

Attributes inherited from LocalizedObject

#base_obj, #formatter, #locale

Instance Method Summary collapse

Methods inherited from LocalizedDateTime

#ago, #initialize, #to_date, #to_s, #to_time, #until

Methods inherited from LocalizedObject

#initialize

Constructor Details

This class inherits a constructor from TwitterCldr::LocalizedDateTime

Instance Method Details

#to_datetime(date) ⇒ Object


14
15
16
17
# File 'lib/twitter_cldr/core_ext/calendars/time.rb', line 14

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