protected function parseReferenceDate($referenceDateString)
    {
        $referenceDateParts = explode('/', $referenceDateString, 2);

        if (count($referenceDateParts) === 1) {
            // assume a valid Date/Time string
            return new \DateTime($referenceDateParts[0]);
        }
        // check if the period (the interval) is the first or second item:
        if (strpos($referenceDateParts[0], 'P') === 0) {
            $interval = new \DateInterval($referenceDateParts[0]);
            $date = new \DateTime($referenceDateParts[1]);
            return $date->sub($interval);
        } elseif (strpos($referenceDateParts[1], 'P') === 0) {
            $interval = new \DateInterval($referenceDateParts[1]);
            $date = new \DateTime($referenceDateParts[0]);
            return $date->add($interval);
        } else {
            throw new InvalidValidationOptionsException(sprintf('There is no valid interval declaration in "%s". Exactly one part must begin with "P".', $referenceDateString), 1324314462);
        }
    }