Sha256: 1d8379cfdf8b6eb81937079de19ea494bbb6865b74549ddf041c3e869e866579

Contents?: true

Size: 564 Bytes

Versions: 7

Compression:

Stored size: 564 Bytes

Contents

# encoding: UTF-8

# Copyright 2012 Twitter, Inc
# http://www.apache.org/licenses/LICENSE-2.0

module TwitterCldr
  module Localized

    class LocalizedDate < LocalizedDateTime
      def to_datetime(time)
        time_obj = time.is_a?(LocalizedTime) ? time.base_obj : time
        LocalizedDateTime.new(DateTime.parse("#{@base_obj.strftime("%Y-%m-%d")}T#{time_obj.strftime("%H:%M:%S%z")}"), @locale, :calendar_type => @calendar_type)
      end

      protected

      def formatter_const
        TwitterCldr::Formatters::DateFormatter
      end
    end

  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
twitter_cldr-2.0.2 lib/twitter_cldr/localized/localized_date.rb
twitter_cldr-2.0.1 lib/twitter_cldr/localized/localized_date.rb
twitter_cldr-2.0.0 lib/twitter_cldr/localized/localized_date.rb
twitter_cldr-1.9.1 lib/twitter_cldr/localized/localized_date.rb
twitter_cldr-1.9.0 lib/twitter_cldr/localized/localized_date.rb
twitter_cldr-1.8.1 lib/twitter_cldr/localized/localized_date.rb
twitter_cldr-1.8.0 lib/twitter_cldr/localized/localized_date.rb