protected function verifyDates($from, $to, $format = 'YmdHs')
    {
        if (!DateTime::createFromFormat($format, $from)) {
            $message = 'The $from date is improperly formatted. Please use "YmdHs".';
            throw new \InvalidArgumentException($message);
        }
        if (!DateTime::createFromFormat($format, $to)) {
            $message = 'The $to date is improperly formatted. Please use "YmdHs".';
            throw new \InvalidArgumentException($message);
        }
        if (new DateTime($from) > new DateTime($to)) {
            $message = 'The $from date cannot be a later date than the $to date.';
            throw new \InvalidArgumentException($message);
        }
    }