The uploaded file
Data-FormValidator-Constraints-DateTime-1.02.tar.gz
has entered CPAN as
file:
$CPAN/authors/id/W/WO/WONKO/Data-FormValidator-Constraints-DateTime-1.02.tar.gz
size: 8140 bytes
md5: 1f446d48a21e73fe1c73103c9412b6a9
No action is required on your part
Request entered by: WONKO (Michael Peters)
Request entered on: Tue, 26 Jul 2005 14:03:51 GMT
Request completed: Tue, 26 Jul 2005 14:05:50 GMT
NAME
Data::FormValidator::Constraints::DateTime - D::FV constraints for dates
and times
DESCRIPTION
This package provides constraint routines for Data::FormValidator for
dealing with dates and times. It provides an easy mechanism for
validating dates of any format (using strptime(3)) and transforming
those dates (as long as you 'untaint' the fields) into valid DateTime
objects, or into strings that would be properly formatted for various
database engines.
ABSTRACT
use Data::FormValidator;
# create our profile
my $profile = {
validator_packages =>
[qw(Data::FormValidator::Constraints::DateTime)],
required => [qw(my_date)],
constraints => {
# my_date is in the format MM/DD/YYYY
my_date => {
constraint_method => 'to_datetime',
params => [\'%D'], # some valid strptime
format string
},
},
untaint_all_constraints => 1,
};
# validate 'my_date'
my $results = Data::FormValidator->check($my_input, $profile);
unless( $results->has_missing || $results->has_invalid ) {
# if we got here then $results->valid('my_date')
# is a valid DateTime object
my $datetime = $results->valid('my_date');
.
.
}
--
Michael Peters
Developer
Plus Three, LP
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/suppressed/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.