Skip Menu |

This queue is for tickets about the Data-FormValidator CPAN distribution.

Maintainer(s)' notes

This is the bug queue for Data::FormValidator.

Report information
The Basics
Id: 12111
Status: resolved
Priority: 0/
Queue: Data-FormValidator

People
Owner: MARKSTOS [...] cpan.org
Requestors: jmay [...] pobox.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.9
Fixed in: (no value)



Subject: Data::FormValidator::Constraints::Dates 0.03 can't handle MMDDYYYY
The date validation in Data::FormValidator::Constraints::Dates seems to require delimiters between components: MM/DD/YYYY works YYYY-MM-DD works but not MMDDYYYY or YYYYMMDD Without the delims, you get a validation error even on correct date. -Jason #!/usr/bin/perl use strict; use Data::FormValidator; use Data::Dumper; my $rules = { validator_packages => [qw(Data::FormValidator::Constraints::Dates)]\ , required => [ qw/dob/ ], constraints => { dob => { constraint_method => "date_and_time", params => [ \ "MMDDYYYY" ], }, }, msgs => { missing => "Required", invalid => "Wrong!", format => "%s", constraints => { date_and_time => "Bad date format", }, }, }; my $data = { dob => "02041990", }; my $results = Data::FormValidator->check($data, $rules); print STDERR Dumper($results->msgs);