Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2342033
PhabricatorSearchDateField.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
849 B
Referenced Files
None
Subscribers
None
PhabricatorSearchDateField.php
View Options
<?php
final
class
PhabricatorSearchDateField
extends
PhabricatorSearchField
{
protected
function
newControl
()
{
return
new
AphrontFormTextControl
();
}
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
;
}
return
PhabricatorTime
::
parseLocalTime
(
$value
,
$this
->
getViewer
());
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Sep 16, 9:40 AM (1 d, 23 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
395248
Default Alt Text
PhabricatorSearchDateField.php (849 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment