function DateTimeRangeTrait::startDateIsDisplayed

Same name in other branches
  1. 10 core/modules/datetime_range/src/DateTimeRangeTrait.php \Drupal\datetime_range\DateTimeRangeTrait::startDateIsDisplayed()

Gets whether the start date should be displayed.

Return value

bool True if the start date should be displayed. False otherwise.

2 calls to DateTimeRangeTrait::startDateIsDisplayed()
DateTimeRangeTrait::renderStartEnd in core/modules/datetime_range/src/DateTimeRangeTrait.php
Creates a render array given start/end dates.
DateTimeRangeTrait::renderStartEndWithIsoAttribute in core/modules/datetime_range/src/DateTimeRangeTrait.php
Creates a render array with ISO attributes given start/end dates.

File

core/modules/datetime_range/src/DateTimeRangeTrait.php, line 134

Class

DateTimeRangeTrait
Provides friendly methods for datetime range.

Namespace

Drupal\datetime_range

Code

protected function startDateIsDisplayed() : bool {
    switch ($this->getSetting('from_to')) {
        case DateTimeRangeConstantsInterface::BOTH:
        case DateTimeRangeConstantsInterface::START_DATE:
            return TRUE;
    }
    return FALSE;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.