Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
f8667f1a
Commit
f8667f1a
authored
Mar 13, 2014
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2736 from ivokund/patch-1
Fixes #2735 - Formatter support for DateTimeInterface
parents
0013b608
f3a7c03f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
CHANGELOG.md
framework/CHANGELOG.md
+1
-0
Formatter.php
framework/base/Formatter.php
+1
-1
No files found.
framework/CHANGELOG.md
View file @
f8667f1a
...
...
@@ -139,6 +139,7 @@ Yii Framework 2 Change Log
-
Enh #2646: Added support for specifying hostinfo in the pattern of a URL rule (qiangxue)
-
Enh #2661: Added boolean column type support for SQLite (qiangxue)
-
Enh #2670: Changed
`console\Controller::globalOptions()`
to
`options($actionId)`
to (make it possible to) differentiate options per action (hqx)
-
Enh #2735: Added support for
`DateTimeInterface`
in
`Formatter`
(ivokund)
-
Enh: Added support for using arrays as option values for console commands (qiangxue)
-
Enh: Added
`favicon.ico`
and
`robots.txt`
to default application templates (samdark)
-
Enh: Added
`Widget::autoIdPrefix`
to support prefixing automatically generated widget IDs (qiangxue)
...
...
framework/base/Formatter.php
View file @
f8667f1a
...
...
@@ -339,7 +339,7 @@ class Formatter extends Component
{
if
(
is_string
(
$value
))
{
return
is_numeric
(
$value
)
||
$value
===
''
?
(
int
)
$value
:
strtotime
(
$value
);
}
elseif
(
$value
instanceof
DateTime
)
{
}
elseif
(
$value
instanceof
DateTime
||
$value
instanceof
\DateTimeInterface
)
{
return
$value
->
getTimestamp
();
}
else
{
return
(
int
)
$value
;
...
...
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