You are here

protected function CalendarValidator::getDefaultReplacementFormat in Calendar 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/views/argument_validator/CalendarValidator.php \Drupal\calendar\Plugin\views\argument_validator\CalendarValidator::getDefaultReplacementFormat()

Get default format value for the options form.

Return value

string

1 call to CalendarValidator::getDefaultReplacementFormat()
CalendarValidator::buildOptionsForm in src/Plugin/views/argument_validator/CalendarValidator.php
Provides the default form for setting options.

File

src/Plugin/views/argument_validator/CalendarValidator.php, line 101

Class

CalendarValidator
Defines a argument validator plugin for Date arguments used in Calendar.

Namespace

Drupal\calendar\Plugin\views\argument_validator

Code

protected function getDefaultReplacementFormat() {
  switch ($this->argumentWrapper
    ->getGranularity()) {
    case 'month':
      return 'F Y';
    case 'year':
      return 'Y';
    case 'week':
      return 'F j, Y';
    case 'day':
      return 'l, F j, Y';
    default:

      // @todo Load format used for medium here
      return 'F j, Y';
  }
}