src/Subjects/AbstractSubject.php
/**
     * Tries to format the passed value to a valid date with format 'Y-m-d H:i:s'.
     * If the passed value is NOT a valid date, NULL will be returned.
     *
     * @param string $value The value to format
     *
     * @return string|null The formatted date or NULL if the date is not valid
     * @throws \InvalidArgumentException Is thrown, if the passed can not be formatted according to the configured date format
     */
Tries to format the passed value to a valid date with format 'Y-m-d H:i:s'.
If the passed value is NOT a valid date, NULL will be returned.

@param string $value The value to format

@return string|null The formatted date or NULL if the date is not valid
@throws \InvalidArgumentException Is thrown, if the passed can not be formatted according to the configured date format
Tries to format the passed value to a valid date with format ' Y - m - d H : i : s ' . If the passed value is NOT a valid date NULL will be returned . @param string $value The value to format @return string|null The formatted date or NULL if the date is not valid @throws \ InvalidArgumentException Is thrown if the passed can not be formatted according to the configured date format
public function formatDate($value)
    {
        $formattedDate = $this->getDateConverter()->convert($value);
        if ($formattedDate === null) {
            throw new \InvalidArgumentException(
                sprintf('Can\'t format date "%s" according given format "%s"', $value, $this->getSourceDateFormat())
            );
        }
        return $formattedDate;
    }
public function formatDate ( $ value ) { $ formattedDate = $ this -> getDateConverter ( ) -> convert ( $ value ) ; if ( $ formattedDate === null ) { throw new \ InvalidArgumentException ( sprintf ( 'Can\'t format date "%s" according given format "%s"' , $ value , $ this -> getSourceDateFormat ( ) ) ) ; } return $ formattedDate ; }
Tries to format the passed value to a valid date with format 'Y-m-d H:i:s'.
Tries to format the passed value to a valid date with format ' Y - m - d H : i : s ' .
// try to format the date according to the configured date format // query whether or not the formatting was successufull // return the formatted date