3 namespace Drupal\datetime\Plugin\views\argument;
5 use Drupal\views\Plugin\views\argument\Date as NumericDate;
8 * Abstract argument handler for dates.
10 * Adds an option to set a default argument based on the current date.
13 * - many to one: If true, the "many to one" helper will be used.
14 * - invalid input: A string to give to the user for obviously invalid input.
15 * This is deprecated in favor of argument validators.
17 * @see \Drupal\views\ManyTonOneHelper
19 * @ingroup views_argument_handlers
21 * @ViewsArgument("datetime")
23 class Date extends NumericDate {
28 public function getDateField() {
29 // Return the real field, since it is already in string format.
30 return "$this->tableAlias.$this->realField";
36 public function getDateFormat($format) {
37 // Pass in the string-field option.
38 return $this->query->getDateFormat($this->getDateField(), $format, TRUE);