package LIMS::Local::Search::Types::DateTime;

use Moose::Util::TypeConstraints;
use LIMS::Local::Utils ();

subtype 'DateTime' => as 'Object' => where { $_->isa('DateTime') };

type 'DOB' => where { LIMS::Local::Utils::check_date($_) };

coerce 'DateTime' => from 'DOB' => via { LIMS::Local::Utils::to_datetime($_) };

1;