Help for this page

Select Code to Download


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