DateConstraint
public struct DateConstraint : Constraint
A constraint to validate if a value is a valid date.
-
A default error message to show if no custom error message is provided.
Declaration
Swift
public static let message: String
-
A custom
DateFormatter
.Declaration
Swift
public let dateFormatter: DateFormatter
-
A custom error message.
Declaration
Swift
public let message: String
-
See
Constraint
.Declaration
Swift
public let groups: Set<Group>
-
A validator named
DateValidator
to validate a value.Declaration
Swift
public let validator: ConstraintValidator
-
Initializes a new instance with a custom
DateFormatter
, a custom error message and a set ofGroup
s to group by.Declaration
Parameters
dateFormatter
A custom
DateFormatter
. Defaults to the “iso8601”DateFormatter
.message
A custom error message. Defaults to the default error message.
groups
A set of
Group
s to group by. Defaults to an empty set.