Class: Coalla::TableFormatter::DateFormatter

Inherits:
SimpleFormatter show all
Defined in:
lib/coalla/builders/table_formatter.rb

Instance Method Summary collapse

Methods inherited from SimpleFormatter

#format_value

Constructor Details

#initialize(default_format = '%d.%m.%Y') ⇒ DateFormatter

Returns a new instance of DateFormatter.



28
29
30
# File 'lib/coalla/builders/table_formatter.rb', line 28

def initialize(default_format = '%d.%m.%Y')
  @default_format = default_format
end

Instance Method Details

#customize(item) ⇒ Object



32
33
34
35
# File 'lib/coalla/builders/table_formatter.rb', line 32

def customize(item)
  item = item.localtime if item.respond_to?(:localtime)
  Russian::strftime(item, @default_format)
end