Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. DateTimeRangeTrait.php

function DateTimeRangeTrait::getFromToOptions

Returns a list of possible values for the 'from_to' setting.

Return value

array A list of 'from_to' options.

2 calls to DateTimeRangeTrait::getFromToOptions()
DateTimeRangeTrait::dateTimeRangeSettingsForm in core/modules/datetime_range/src/DateTimeRangeTrait.php
Configuration form for date time range.
DateTimeRangeTrait::dateTimeRangeSettingsSummary in core/modules/datetime_range/src/DateTimeRangeTrait.php
Gets the date time range settings summary.

File

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

Class

DateTimeRangeTrait
Provides friendly methods for datetime range.

Namespace

Drupal\datetime_range

Code

protected function getFromToOptions() : array {
    return [
        DateTimeRangeConstantsInterface::BOTH => $this->t('Display both start and end dates'),
        DateTimeRangeConstantsInterface::START_DATE => $this->t('Display start date only'),
        DateTimeRangeConstantsInterface::END_DATE => $this->t('Display end date only'),
    ];
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal