File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed
Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change 66
77class DateResolver
88{
9- public function resolveDateToFormat (string $ format , DateTime $ date = null )
9+ public function resolveDateToFormat ($ date , $ args )
1010 {
11- if ($ date === null ) {
12- return $ date ;
11+ if (!$ date instanceof DateTime) {
12+ return null ;
13+ }
14+
15+ if (isset ($ args ['pattern ' ])) {
16+ return $ date ->format ($ args ['pattern ' ]);
17+ }
18+
19+ if (isset ($ args ['constant ' ])) {
20+ return $ date ->format ($ args ['constant ' ]);
1321 }
14- return $ date ->format ($ format );
1522 }
1623}
Original file line number Diff line number Diff line change @@ -25,9 +25,9 @@ DateTime:
2525 description : " Date formatted with a date() format"
2626 resolve : " @=resolver('DateTimeFormat', [value, args])"
2727 args :
28- format :
28+ pattern :
2929 type : " String"
30- description : " A format compatible with date()"
30+ description : " A pattern compatible with date()"
3131 constant :
3232 type : DateFormatConstant
3333 timestamp :
You can’t perform that action at this time.
0 commit comments