Started on user day entry
This commit is contained in:
parent
b03b7ccc5f
commit
1598909958
6 changed files with 142 additions and 1 deletions
|
@ -5,6 +5,7 @@ use Email::Valid;
|
|||
use Geo::UK::Postcode;
|
||||
use Scalar::Util qw/ looks_like_number /;
|
||||
use File::Basename;
|
||||
use DateTime::Format::Strptime;
|
||||
|
||||
sub register {
|
||||
my ( $plugin, $app, $conf ) = @_;
|
||||
|
@ -45,6 +46,12 @@ sub register {
|
|||
$extension =~ s/^\.//;
|
||||
return $app->types->type($extension) eq $filetype ? undef : 1;
|
||||
});
|
||||
|
||||
$app->validator->add_check( is_iso_datetime => sub {
|
||||
my ( $validation, $name, $value ) = @_;
|
||||
$value = $app->datetime_formatter->parse_datetime( $value );
|
||||
return defined $value ? undef : 1;
|
||||
});
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
Reference in a new issue