Skip to content

Modifying Date Format In Error Messages

Grondhammar edited this page Feb 19, 2016 · 1 revision

Modifying Date Formats In Error Messages

To modify the date format in error messages generated by validates_timeliness, add the following block to the locale file(s) in your application's config/locales directory:

en:
  validates_timeliness:
    error_value_formats:
      date: '%m/%d/%Y'
      time: '%H:%M:%S'
      datetime: '%m/%d/%Y %H:%M:%S'

The formatted sections can be any valid strftime-formatted string.

Clone this wiki locally