summaryrefslogtreecommitdiff
path: root/GroLUG/lib/HTML/Widget/Constraint/ISODate.pm
blob: f5680d250d83b0d4ba4a88be150d45af17c1aa40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package HTML::Widget::Constraint::ISODate; 
 
use warnings;
use strict;
use base 'HTML::Widget::Constraint';
use DateTime::Format::Strptime;
 
my $format=DateTime::Format::Strptime->new(pattern=>'%F');
 
sub validate {
    my ($self,$value)=@_;
 
    my $val=$format->parse_datetime($value);
 
    return defined($val);
}
 
1;