Class: TwitterCldr::Formatters::DateFormatter

Inherits:
DateTimeFormatter show all
Defined in:
lib/twitter_cldr/formatters/calendars/date_formatter.rb

Constant Summary

Constants inherited from DateTimeFormatter

TwitterCldr::Formatters::DateTimeFormatter::METHODS, TwitterCldr::Formatters::DateTimeFormatter::WEEKDAY_KEYS

Instance Attribute Summary

Attributes inherited from Base

#tokenizer

Instance Method Summary collapse

Methods inherited from DateTimeFormatter

#additional_format_selector, additional_formats_for, #result_for_token

Methods inherited from Base

#format

Constructor Details

#initialize(options = {}) ⇒ DateFormatter

Returns a new instance of DateFormatter.



9
10
11
12
13
14
15
16
# File 'lib/twitter_cldr/formatters/calendars/date_formatter.rb', line 9

def initialize(options = {})
  locale = extract_locale(options)
  cache_key = TwitterCldr::Utils.compute_cache_key("date", locale, options[:calendar_type])
  @tokenizer = tokenizer_cache[cache_key] ||= TwitterCldr::Tokenizers::DateTokenizer.new(
    :locale => locale,
    :calendar_type => options[:calendar_type]
  )
end