Added receipt datetime string submission validation & validator test

This commit is contained in:
Finn 2017-08-14 15:35:23 +01:00
parent 65d5bab444
commit d078a09ccd
3 changed files with 16 additions and 3 deletions

View file

@ -58,6 +58,12 @@ sub register {
$value = $app->datetime_formatter->parse_datetime( $value );
return defined $value ? undef : 1;
});
$app->validator->add_check( is_full_iso_datetime => sub {
my ( $validation, $name, $value ) = @_;
$value = $app->parse_iso_datetime( $value );
return defined $value ? undef : 1;
});
}
1;