private function parseDate($rawDate)
    {
        foreach (['Y-m-d', 'Y-m', 'Y'] as $dateFormat) {
            $publishedDate = DateTime::createFromFormat($dateFormat.'|', $rawDate);
            if ($publishedDate !== false) {
                break;
            }
        }

        if ($publishedDate === false) {
            $publishedDate = null;
        }

        return [$publishedDate, $dateFormat];
    }
private function parseDate($rawDate)
    {
        foreach (['Y-m-d', 'Y-m', 'Y'] as $dateFormat) {
            $publishedDate = DateTime::createFromFormat($dateFormat.'|', $rawDate);
            if ($publishedDate !== false) {
                break;
            }
        }

        if ($publishedDate === false) {
            $publishedDate = null;
        }

        return [$publishedDate, $dateFormat];
    }
private function parseDate ( $ rawDate ) { foreach ( [ 'Y-m-d' , 'Y-m' , 'Y' ] as $ dateFormat ) { $ publishedDate = DateTime :: createFromFormat ( $ dateFormat . '|' , $ rawDate ) ; if ( $ publishedDate !== false ) { break ; } } if ( $ publishedDate === false ) { $ publishedDate = null ; } return [ $ publishedDate , $ dateFormat ] ; }
Parse the publication date.

@param string $rawDate

@return array The publication in DateTime and the date format
Parse the publication date .