codegram / date_validator

A simple, ORM agnostic, Ruby >=2.2 compatible date validator for Rails, based on ActiveModel.
http://thoughts.codegram.com/date-validation-with-rails-3
MIT License
495 stars 82 forks source link

Allow dates to be formatted in error messages #49

Closed rathgar closed 4 years ago

rathgar commented 10 years ago

Allow users to format the dates displayed in errors. Uses different format for each type. e.g.:

en-GB:
  formats:
    date_validator:
      date_time: '%d %b %I:%M %p'
      time: '%I:%M %p'

Falls back to :default behaviour if no translation is found so will continue to format as it currently does.

oriolgual commented 9 years ago

I know this is really old, but could you add a test for it?

mrcasals commented 4 years ago

Closing due to inactivity.