You are here

public function Date::getDateFormat in Zircon Profile 8

Same name in this branch
  1. 8 core/modules/datetime/src/Plugin/views/sort/Date.php \Drupal\datetime\Plugin\views\sort\Date::getDateFormat()
  2. 8 core/modules/datetime/src/Plugin/views/argument/Date.php \Drupal\datetime\Plugin\views\Argument\Date::getDateFormat()
Same name and namespace in other branches
  1. 8.0 core/modules/datetime/src/Plugin/views/argument/Date.php \Drupal\datetime\Plugin\views\Argument\Date::getDateFormat()

Creates cross-database SQL date formatting.

Parameters

string $format: A format string for the result, like 'Y-m-d H:i:s'.

Return value

string An appropriate SQL string for the DB type and field type.

Overrides HandlerBase::getDateFormat

File

core/modules/datetime/src/Plugin/views/argument/Date.php, line 41
Contains \Drupal\datetime\Plugin\views\Argument\Date.

Class

Date
Abstract argument handler for dates.

Namespace

Drupal\datetime\Plugin\views\Argument

Code

public function getDateFormat($format) {

  // Pass in the string-field option.
  return $this->query
    ->getDateFormat($this
    ->getDateField(), $format, TRUE);
}