Upgrade to 3.5

This commit is contained in:
Bastian Allgeier
2020-12-15 11:01:41 +01:00
parent eabce32cf0
commit 9109130c9c
43 changed files with 306 additions and 159 deletions

View File

@@ -4,13 +4,17 @@ return [
'methods' => [
'toDatetime' => function ($value, string $format = 'Y-m-d H:i:s') {
if ($timestamp = timestamp($value, $this->step)) {
return $this->toISO($timestamp, $format);
return date($format, $timestamp);
}
return null;
},
'toISO' => function (int $time, string $format = 'Y-m-d H:i:s') {
return date($format, $time);
'toContent' => function ($value, string $format = 'Y-m-d H:i:s') {
if ($value !== null && $timestamp = strtotime($value)) {
return date($format, $timestamp);
}
return '';
}
]
];