Class: Wallaby::Resources::Index::DateHtml

Inherits:
Cell
  • Object
show all
Defined in:
app/views/wallaby/resources/index/date_html.rb

Overview

Html cell

Instance Method Summary collapse

Instance Method Details

#renderString

Returns:

  • (String)


9
10
11
12
13
14
15
16
17
# File 'app/views/wallaby/resources/index/date_html.rb', line 9

def render
  if value.nil?
    null
  else
    self.value = Time.zone.parse value if value.is_a? String
    self.value = value.to_date if value.is_a? Time
    I18n.l value
  end
end