public function isValid()
    {
        $value = $this->field->getValue();

        // field is empty and its not required. It's thus valid.
        if ($value == '' && $this->required == false) {
            return true;
        }

        $parsedDate = date_parse($value);

        if ($parsedDate['warning_count'] == 0 &&
            $parsedDate['error_count'] == 0 &&
            isset($parsedDate['year']) &&
            isset($parsedDate['month'])
        ) {
            return true;
        }

        return false;
    }
public function isValid()
    {
        $value = $this->field->getValue();

        // field is empty and its not required. It's thus valid.
        if ($value == '' && $this->required == false) {
            return true;
        }

        $parsedDate = date_parse($value);

        if ($parsedDate['warning_count'] == 0 &&
            $parsedDate['error_count'] == 0 &&
            isset($parsedDate['year']) &&
            isset($parsedDate['month'])
        ) {
            return true;
        }

        return false;
    }
public function isValid ( ) { $ value = $ this -> field -> getValue ( ) ; // field is empty and its not required. It's thus valid. if ( $ value == '' && $ this -> required == false ) { return true ; } $ parsedDate = date_parse ( $ value ) ; if ( $ parsedDate [ 'warning_count' ] == 0 && $ parsedDate [ 'error_count' ] == 0 && isset ( $ parsedDate [ 'year' ] ) && isset ( $ parsedDate [ 'month' ] ) ) { return true ; } return false ; }
Check if the given field is valid or not. The date should be parsable by strtotime.

@return boolean
Check if the given field is valid or not . The date should be parsable by strtotime .