StringDateNode<T extends String> class
Validates strings as formatted dates/times.
Supports custom formats, ISO-8601, date ranges, and leap year checks.
Example:
Checkit.string
.dateTime('yyyy-MM-dd')
.notFuture()
.minYear(2000);
- Inheritance
-
- Object
- ValidatorNode<
T, StringDateNode< T> > - StringDateNode
Constructors
- StringDateNode(ValidationContext _context)
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
after(
String date, {String? error}) → StringDateNode< String> - Requires the date to be after a specific date.
-
any(
List< Validator< validators, {String? error}) → StringDateNode<T> >T> -
inherited
-
before(
String date, {String? error}) → StringDateNode< String> - Requires the date to be before a specific date.
-
build(
{ValidationContext? context}) → ValidatorSet< T> -
Finalizes the validator into a reusable set.
inherited
-
clone(
{ValidationContext? context}) → StringDateNode< T> -
Clones this node with an optional different context.
override
-
custom(
bool validate(T value, ValidationContext context), {String error = ''}) → StringDateNode< T> -
Adds a custom validator using a function.
inherited
-
every(
List< Validator< validators, {String? error}) → StringDateNode<T> >T> -
inherited
-
format(
String format, {String? error}) → StringDateNode< String> - Requires a specific date format.
-
iso8601(
{String? error}) → StringDateNode< String> - Requires the date to be in ISO 8601 format.
-
leapYear(
{String? error}) → StringDateNode< String> - Requires the date to be in a leap year.
-
maxYear(
int max, {String? error}) → StringDateNode< String> - Specifies the maximum allowed year for the date.
-
minYear(
int min, {String? error}) → StringDateNode< String> - Specifies the minimum allowed year for the date.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
not(
Validator< T> validator, {String? error}) → StringDateNode<T> -
Negates another validator.
inherited
-
notFuture(
{String? error}) → StringDateNode< String> - Requires the date to not be in the future (relative to now).
-
notPast(
{String? error}) → StringDateNode< String> - Requires the date to not be in the past (relative to now).
-
range(
String start, String end, {String? error, bool inclusive = false}) → StringDateNode< String> - Requires the date to be within the specified range.
-
toString(
) → String -
A string representation of this object.
inherited
-
validateOnce(
T? value, {bool? stopOnFirstError}) → ValidationResult -
Quick validation without manually building the set.
inherited
-
withContext(
ValidationContext context) → StringDateNode< T> -
Shortcut to clone with updated context.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited