Date Rules
IsDate
must be a valid date
Parameters:
- date_format (str, optional): The date format to be used for validation. If not provided, the default format is
%Y-%m-%d
. - message (str, optional): The error message to be used if the validation fails.
Example
DateEquals
Validate that the provided date value is equal to the target date.
Parameters:
- target_date: (datetime.date) the date to compare against
- date_format: (str,optional) the date format to validate the date against (default: %Y-%m-%d)
- message: (str,optional) the error message to return if the validation fails
Example
DateAfter
Validate that the provided date value is after the target date.
Parameters:
- target_date: (datetime.date) the date to compare against
- date_format: (str,optional) the date format to validate the date against (default: %Y-%m-%d)
- message: (str,optional) the error message to return if the validation
Example
DateBefore
Validate that the provided date value is before the target date.
Parameters:
- target_date: (datetime.date) the date to compare against
- date_format: (str,optional) the date format to validate the date against (default: %Y-%m-%d)
- message: (str,optional) the error message to return if the validation