public function normalizeDateValue($date, $outFormat = 'Y-m-d H:i:s', $inFormat = null, $nullable = false)
    {
        if (empty($outFormat)) {
            $outFormat = 'Y-m-d H:i:s';
        }

        if ($date instanceof DateTime) {
            return $date->format($outFormat);
        }

        if (null === $date) {

            if ($nullable) {
                return null;
            }

            return $this->makeEmptyStringDate($outFormat);
        }

        if (null === $inFormat) {

            try {

                $date = new Carbon($date);

            } catch (\Exception $e) {

                if ($nullable) {
                    return null;
                }

                return $this->makeEmptyStringDate($outFormat);
            }

        } else {

            $date = DateTime::createFromFormat($inFormat, $date);
        }

        return $date->format($outFormat);
    }