Upgrade to rc5
This commit is contained in:
16
kirby/config/fields/mixins/datetime.php
Executable file
16
kirby/config/fields/mixins/datetime.php
Executable file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
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 null;
|
||||
},
|
||||
'toISO' => function (int $time, string $format = 'Y-m-d H:i:s') {
|
||||
return date($format, $time);
|
||||
}
|
||||
]
|
||||
];
|
Reference in New Issue
Block a user