ExpressiveDate::isDateAttribute PHP Method

isDateAttribute() protected method

Syntactical sugar for determining if date object "is" a condition.
protected isDateAttribute ( string $attribute ) : mixed
$attribute string
return mixed
    protected function isDateAttribute($attribute)
    {
        switch ($attribute) {
            case 'LeapYear':
                return (bool) $this->format('L');
                break;
            case 'AmOrPm':
                return $this->format('A');
                break;
            case 'DaylightSavings':
                return (bool) $this->format('I');
                break;
        }
        throw new InvalidArgumentException('The date attribute [' . $attribute . '] could not be found.');
    }