Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
solarium
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
solarium
Commits
bc8311c9
Commit
bc8311c9
authored
Jan 13, 2012
by
stefanooldeman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
don't support closures yet and replace checkdate because its bogus
parent
b0f45027
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
library/Solarium/Query/Helper.php
library/Solarium/Query/Helper.php
+12
-5
No files found.
library/Solarium/Query/Helper.php
View file @
bc8311c9
...
@@ -123,18 +123,25 @@ class Solarium_Query_Helper
...
@@ -123,18 +123,25 @@ class Solarium_Query_Helper
return
'"'
.
preg_replace
(
'/("|\\\)/'
,
'\\\$1'
,
$input
)
.
'"'
;
return
'"'
.
preg_replace
(
'/("|\\\)/'
,
'\\\$1'
,
$input
)
.
'"'
;
}
}
protected
function
isTimestamp
(
$timestamp
)
{
try
{
new
DateTime
(
$timestamp
);
}
catch
(
Exception
$e
)
{
return
false
;
}
return
true
;
}
public
function
formatDate
(
$input
)
public
function
formatDate
(
$input
)
{
{
$isTimestamp
=
function
(
$input
)
{
return
checkdate
(
date
(
'm'
,
$input
),
date
(
'd'
,
$input
),
date
(
'Y'
,
$input
));
};
switch
(
true
)
{
switch
(
true
)
{
case
is_numeric
(
$input
)
&&
$isTimestamp
(
$input
)
:
case
is_numeric
(
$input
)
&&
$
this
->
isTimestamp
(
$input
)
:
$dateTime
=
new
DateTime
(
$input
);
$dateTime
=
new
DateTime
(
$input
);
break
;
break
;
case
is_string
(
$input
)
&&
$isTimestamp
(
strtotime
(
$input
))
:
case
is_string
(
$input
)
&&
$
this
->
isTimestamp
(
strtotime
(
$input
))
:
$dateTime
=
new
DateTime
(
strtotime
(
$input
));
$dateTime
=
new
DateTime
(
strtotime
(
$input
));
break
;
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment