3 namespace Drupal\datetime\Plugin\views\sort;
5 use Drupal\views\Plugin\views\sort\Date as NumericDate;
8 * Basic sort handler for datetime fields.
10 * This handler enables granularity, which is the ability to make dates
11 * equivalent based upon nearness.
13 * @ViewsSort("datetime")
15 class Date extends NumericDate {
18 * Override to account for dates stored as strings.
20 public function getDateField() {
21 // Return the real field, since it is already in string format.
22 return "$this->tableAlias.$this->realField";
28 * Overridden in order to pass in the string date flag.
30 public function getDateFormat($format) {
31 return $this->query->getDateFormat($this->getDateField(), $format, TRUE);