Created
August 4, 2025 16:49
-
-
Save junaidpv/1406595a5ab01604ddec84ebb34986c1 to your computer and use it in GitHub Desktop.
Modified https://www.drupal.org/project/drupal/issues/2455971#comment-16216611 to apply on WWM platforms.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/core/modules/views/src/Plugin/views/filter/Date.php b/core/modules/views/src/Plugin/views/filter/Date.php | |
index 84d776c4b64..8d07427e550 100644 | |
--- a/core/modules/views/src/Plugin/views/filter/Date.php | |
+++ b/core/modules/views/src/Plugin/views/filter/Date.php | |
@@ -45,6 +45,13 @@ | |
$form['value'][$component]['#default_value'] = date('m/d/Y', strtotime($form['value'][$component]['#default_value'])); | |
} | |
} | |
+ | |
+ if (isset($form['value']['min'])) { | |
+ $form['value']['min']['#title'] = $this->t('From'); | |
+ } | |
+ if (isset($form['value']['max'])) { | |
+ $form['value']['max']['#title'] = $this->t('To'); | |
+ } | |
} | |
} | |
@@ -220,4 +227,20 @@ | |
$this->query->addWhereExpression($this->options['group'], "$field $this->operator {$values['value']}"); | |
} | |
+ /** | |
+ * {@inheritdoc} | |
+ */ | |
+ public function operators() { | |
+ $operators = parent::operators(); | |
+ $operators['<']['title'] = $this->t('Before'); | |
+ $operators['<=']['title'] = $this->t('Before or On'); | |
+ $operators['=']['title'] = $this->t('On'); | |
+ $operators['!=']['title'] = $this->t('Not On'); | |
+ $operators['>=']['title'] = $this->t('On or After'); | |
+ $operators['>']['title'] = $this->t('After'); | |
+ $operators['between']['title'] = $this->t('Between'); | |
+ $operators['not between']['title'] = $this->t('Not Between'); | |
+ | |
+ return $operators; | |
+ } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment