- or download this
type 'MyApp::DateOnly' => as 'DateTime'
=> where { blessed($_)
&& $_->isa('DateTime')
&& $_->hour == 0 && $_->min == 0 && $_->sec == 0
};
- or download this
coerce 'Search::DateOnly' => from 'DateTime'
=> via { $_->truncate(to => 'day') };
...
pattern => '%Y/%m/%d');
$parser->parse_datetime($_);
};
- or download this
has foo => (
is => 'ro',
isa => 'Maybe[MyApp::DateOnly]',
coerce => 1,
);