Class: Dima::Html::DateField
- Inherits:
-
SimpleField
- Object
- Element
- Field
- SimpleField
- Dima::Html::DateField
- Includes:
- TextEditor
- Defined in:
- lib/dima/html/field.rb
Overview
Display date.
Instance Attribute Summary collapse
-
#formatter ⇒ Object
Returns the value of attribute formatter.
Attributes inherited from SimpleField
#height, #klass, #lambda, #model, #name, #readonly, #width
Attributes inherited from Field
#after, #align, #before, #edit, #form, #has_errors, #hint, #label, #required, #tooltip, #url
Instance Method Summary collapse
Methods included from TextEditor
Methods inherited from SimpleField
#<<, #>>, #empty?, #main_content_node, #readonly?
Methods inherited from Field
#after_node, #before_node, #edit?, #empty_node, #label_node, #options, #to_n, #url_node, #val, #val=, #validate, #value_node
Methods included from Init
Methods inherited from Element
Instance Attribute Details
#formatter ⇒ Object
Returns the value of attribute formatter.
332 333 334 |
# File 'lib/dima/html/field.rb', line 332 def formatter @formatter end |
Instance Method Details
#simple_value_node ⇒ Object
334 335 336 337 338 339 340 341 |
# File 'lib/dima/html/field.rb', line 334 def simple_value_node frmtValue = self.val.strftime(self.formatter || Dima.config.date.formatter) if self.val if self.edit? editor(val: frmtValue, type: 'dim-date', width: width) else Node.new(tag: 'span', attributes: { class: 'dim-main-content dim-date' }, text: frmtValue) end end |