Sha256: da1299a1fb12776b426f9008aeafc0c137559d93d85e85a0cd420acb4645fc77
Contents?: true
Size: 727 Bytes
Versions: 114
Compression:
Stored size: 727 Bytes
Contents
# Customizing `date_field` and `date_and_time_field` Field Partials You can customize the format in which your `Date` and `DateTime` fields appear by passing the `format` option to your render calls. You can also use `date_format` and `time_format` to accomplish the same thing. ```erb <%# For Date objects %> <%= render 'shared/attributes/date', attribute: :date_test, format: "%m/%d" %> <%= render 'shared/attributes/date', attribute: :date_test, date_format: "%m/%d" %> <%# For DateTime objects %> <%= render 'shared/attributes/date_and_time', attribute: :date_time_test, format: "%m/%d %I %p" %> <%= render 'shared/attributes/date_and_time', attribute: :date_time_test, date_format: "%m/%d", time_format: "%I %p" %> ```
Version data entries
114 entries across 114 versions & 1 rubygems