A Rails plugin for comprehensive date, time, and datetime validation with timezone handling and custom format support.
ValidatesTimeliness is a Ruby gem that adds comprehensive date, time, and datetime validation to ActiveModel and Rails applications. It solves the problem of incomplete temporal validation in Rails by handling timezones, custom formats, and invalid value caching, ensuring data integrity for date and time attributes.
Rails developers building applications with date/time inputs, especially those needing robust validation beyond Rails' built-in options, such as e-commerce platforms, booking systems, or any app with temporal constraints.
Developers choose ValidatesTimeliness because it is the only Rails date/time validation plugin offering complete validation across multiple ORMs, with built-in timezone handling, extensible parsing, and fixes for common Rails date/time select issues.
Date and time validation plugin for ActiveModel and Rails. Supports multiple ORMs and allows custom date/time formats.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports dates, times, and datetimes with flexible restrictions like before, after, and between, using objects, procs, or symbols, as shown in the examples with age limits and business hours.
Automatically manages timezones and type casting, ensuring accurate comparisons for international apps, with configurable default timezone settings in the initializer.
Integrates the Timeliness gem for strict, configurable date/time parsing, allowing custom formats and better error handling than Ruby's default parser, though it requires enabling the plugin parser.
Includes extensions to fix Rails date/time select helper quirks and supports I18n for error messages, making it easy to redisplay invalid values and handle multi-language setups.
Requires running a generator, configuring an initializer, and enabling ORM shims for full validation, which adds overhead compared to simpler validation solutions.
Relies on the Timeliness gem for parsing, introducing another dependency that must be maintained and potentially causing compatibility issues with other gems or Ruby versions.
The plugin caches invalid values and uses custom parsing, which might slow down validation for models with frequent saves or large datasets, especially when the parser is enabled.
Primarily designed for Rails and ActiveModel; while it supports ORMs like Mongoid with shims, it's not suitable for non-Ruby frameworks or languages, limiting its applicability.