Page MenuHomestyx hydra

No OneTemporary

diff --git a/src/applications/search/field/PhabricatorSearchDateField.php b/src/applications/search/field/PhabricatorSearchDateField.php
index 21b1627de7..41decd9503 100644
--- a/src/applications/search/field/PhabricatorSearchDateField.php
+++ b/src/applications/search/field/PhabricatorSearchDateField.php
@@ -1,53 +1,54 @@
<?php
final class PhabricatorSearchDateField
extends PhabricatorSearchField {
protected function newControl() {
- return new AphrontFormTextControl();
+ return id(new AphrontFormTextControl())
+ ->setPlaceholder(pht('"2022-12-25" or "7 days ago"...'));
}
protected function getValueFromRequest(AphrontRequest $request, $key) {
return $request->getStr($key);
}
public function getValueForQuery($value) {
return $this->parseDateTime($value);
}
protected function validateControlValue($value) {
if (!strlen($value)) {
return;
}
$epoch = $this->parseDateTime($value);
if ($epoch) {
return;
}
$this->addError(
pht('Invalid'),
pht('Date value for "%s" can not be parsed.', $this->getLabel()));
}
protected function parseDateTime($value) {
if (!strlen($value)) {
return null;
}
// If this appears to be an epoch timestamp, just return it unmodified.
// This assumes values like "2016" or "20160101" are "Ymd".
if (is_int($value) || ctype_digit($value)) {
if ((int)$value > 30000000) {
return (int)$value;
}
}
return PhabricatorTime::parseLocalTime($value, $this->getViewer());
}
protected function newConduitParameterType() {
return new ConduitEpochParameterType();
}
}

File Metadata

Mime Type
text/x-diff
Expires
Fri, Oct 31, 2:57 PM (7 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
312301
Default Alt Text
(1 KB)

Event Timeline