Field/DayOfWeekField.php
private function matchesHash($hash, \DateTime $date)
    {
        $ordinals = array(
            '1' => 'first',
            '2' => 'second',
            '3' => 'third',
            '4' => 'fourth',
            '5' => 'fifth'
        );
        $hashParts = explode('#', $hash);

        if ($hashParts[0] != $this->getFieldValueFromDate($date)) {
            return false;
        }

        return $this->matchesRelativeDate($date, $ordinals[$hashParts[1]]);
    }
private function matchesHash($hash, \DateTime $date)
    {
        $ordinals = array(
            '1' => 'first',
            '2' => 'second',
            '3' => 'third',
            '4' => 'fourth',
            '5' => 'fifth'
        );
        $hashParts = explode('#', $hash);

        if ($hashParts[0] != $this->getFieldValueFromDate($date)) {
            return false;
        }

        return $this->matchesRelativeDate($date, $ordinals[$hashParts[1]]);
    }
private function matchesHash ( $ hash , \ DateTime $ date ) { $ ordinals = array ( '1' => 'first' , '2' => 'second' , '3' => 'third' , '4' => 'fourth' , '5' => 'fifth' ) ; $ hashParts = explode ( '#' , $ hash ) ; if ( $ hashParts [ 0 ] != $ this -> getFieldValueFromDate ( $ date ) ) { return false ; } return $ this -> matchesRelativeDate ( $ date , $ ordinals [ $ hashParts [ 1 ] ] ) ; }
Checks if the hash value matches the given date.

@param string    $hash
@param \DateTime $date

@return Boolean
Checks if the hash value matches the given date .