Tests fixed and API improved and DB upgraded

This commit is contained in:
Finn 2017-09-19 17:23:30 +01:00
parent 8e2cecfcf5
commit 5f241bbd46
12 changed files with 1861 additions and 7 deletions

View file

@ -14,6 +14,10 @@ sub register {
return DateTime::Format::Strptime->new( pattern => '%Y-%m-%d' );
});
$app->helper( iso_month_parser => sub {
return DateTime::Format::Strptime->new( pattern => '%Y-%m' );
});
$app->helper( parse_iso_date => sub {
my ( $c, $date_string ) = @_;
return $c->iso_date_parser->parse_datetime(
@ -28,6 +32,20 @@ sub register {
);
});
$app->helper( parse_iso_month => sub {
my ( $c, $date_string ) = @_;
return $c->iso_month_parser->parse_datetime(
$date_string,
);
});
$app->helper( format_iso_month => sub {
my ( $c, $datetime_obj ) = @_;
return $c->iso_month_parser->format_datetime(
$datetime_obj,
);
});
$app->helper( parse_iso_datetime => sub {
my ( $c, $date_string ) = @_;
return $c->iso_datetime_parser->parse_datetime(