protected function validateDate(string &$strDate)
    {
        if (!preg_match("/\d{4}\-\d{2}-\d{2}/", $strDate)) {
            if ($iTime = strtotime($strDate)) {
                $strDate = date('Y-m-d', $iTime);
            } else {
                throw new \Exception(
                    'Invalid date string given to ' . debug_backtrace()[1]['function']
                        . '. Use format YYYY-MM-DD.'
                );
            }
        }
    }