##
coerce 'Search::DateOnly' => from 'DateTime'
=> via { $_->truncate(to => 'day') };
coerce 'Search::DateOnly' => from 'Str'
=> via
{
state $parser = DateTime::Format::Strptime->new(
pattern => '%Y/%m/%d');
$parser->parse_datetime($_);
};
####
has foo => (
is => 'ro',
isa => 'Maybe[MyApp::DateOnly]',
coerce => 1,
);