-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
validate_timeliness not working.... made some changes
- Loading branch information
Showing
6 changed files
with
62 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
ValidatesTimeliness.setup do |config| | ||
# Extend ORM/ODMs for full support (:active_record, :mongoid). | ||
# config.extend_orms = [ :active_record ] | ||
# | ||
# Default timezone | ||
# config.default_timezone = :utc | ||
# | ||
# Set the dummy date part for a time type values. | ||
# config.dummy_date_for_time_type = [ 2000, 1, 1 ] | ||
# | ||
# Ignore errors when restriction options are evaluated | ||
# config.ignore_restriction_errors = false | ||
# | ||
# Re-display invalid values in date/time selects | ||
# config.enable_date_time_select_extension! | ||
# | ||
# Handle multiparameter date/time values strictly | ||
# config.enable_multiparameter_extension! | ||
# | ||
# Shorthand date and time symbols for restrictions | ||
# config.restriction_shorthand_symbols.update( | ||
# :now => lambda { Time.current }, | ||
# :today => lambda { Date.current } | ||
# ) | ||
# | ||
# Use the plugin date/time parser which is stricter and extendable | ||
# config.use_plugin_parser = false | ||
# | ||
# Add one or more formats making them valid. e.g. add_formats(:date, 'd(st|rd|th) of mmm, yyyy') | ||
# config.parser.add_formats() | ||
# | ||
# Remove one or more formats making them invalid. e.g. remove_formats(:date, 'dd/mm/yyy') | ||
# config.parser.remove_formats() | ||
# | ||
# Change the amiguous year threshold when parsing a 2 digit year | ||
# config.parser.ambiguous_year_threshold = 30 | ||
# | ||
# Treat ambiguous dates, such as 01/02/1950, as a Non-US date. | ||
# config.parser.remove_us_formats | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
en: | ||
errors: | ||
messages: | ||
invalid_date: "is not a valid date" | ||
invalid_time: "is not a valid time" | ||
invalid_datetime: "is not a valid datetime" | ||
is_at: "must be at %{restriction}" | ||
before: "must be before %{restriction}" | ||
on_or_before: "must be on or before %{restriction}" | ||
after: "must be after %{restriction}" | ||
on_or_after: "must be on or after %{restriction}" | ||
validates_timeliness: | ||
error_value_formats: | ||
date: '%Y-%m-%d' | ||
time: '%H:%M:%S' | ||
datetime: '%Y-%m-%d %H:%M:%S' |