protected static function parseDate(
        string $date,
        string $format = null,
        string $output = null
    ) {
        $d = \DateTime::createFromFormat($format ?? static::DATE_FORMAT, $date);
        return ($d ? $d->format($output ?? 'Y-m-d') : null);
    }
protected static function parseDate(
        string $date,
        string $format = null,
        string $output = null
    ) {
        $d = \DateTime::createFromFormat($format ?? static::DATE_FORMAT, $date);
        return ($d ? $d->format($output ?? 'Y-m-d') : null);
    }
protected static function parseDate ( string $ date , string $ format = null , string $ output = null ) { $ d = \ DateTime :: createFromFormat ( $ format ?? static :: DATE_FORMAT , $ date ) ; return ( $ d ? $ d -> format ( $ output ?? 'Y-m-d' ) : null ) ; }
Parses a date to Y-m-d

@param string $date   Date string
@param string $format Expected date $format (defaults to DATE_FORMAT)
@param string $output Iutput format (defaults to Y-m-d)

@return string On success
@return null   On failure
Parses a date to Y - m - d