Update Kirby and dependencies
This commit is contained in:
parent
503b339974
commit
399fa20902
439 changed files with 66915 additions and 64442 deletions
|
@ -3,33 +3,33 @@
|
|||
use Kirby\Toolkit\Date;
|
||||
|
||||
return [
|
||||
'props' => [
|
||||
/**
|
||||
* Defines a custom format that is used when the field is saved
|
||||
*/
|
||||
'format' => function (string $format = null) {
|
||||
return $format;
|
||||
}
|
||||
],
|
||||
'methods' => [
|
||||
'toDatetime' => function ($value, string $format = 'Y-m-d H:i:s') {
|
||||
if ($date = Date::optional($value)) {
|
||||
if ($this->step) {
|
||||
$step = Date::stepConfig($this->step);
|
||||
$date->round($step['unit'], $step['size']);
|
||||
}
|
||||
'props' => [
|
||||
/**
|
||||
* Defines a custom format that is used when the field is saved
|
||||
*/
|
||||
'format' => function (string $format = null) {
|
||||
return $format;
|
||||
}
|
||||
],
|
||||
'methods' => [
|
||||
'toDatetime' => function ($value, string $format = 'Y-m-d H:i:s') {
|
||||
if ($date = Date::optional($value)) {
|
||||
if ($this->step) {
|
||||
$step = Date::stepConfig($this->step);
|
||||
$date->round($step['unit'], $step['size']);
|
||||
}
|
||||
|
||||
return $date->format($format);
|
||||
}
|
||||
return $date->format($format);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
],
|
||||
'save' => function ($value) {
|
||||
if ($date = Date::optional($value)) {
|
||||
return $date->format($this->format);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
],
|
||||
'save' => function ($value) {
|
||||
if ($date = Date::optional($value)) {
|
||||
return $date->format($this->format);
|
||||
}
|
||||
|
||||
return '';
|
||||
},
|
||||
return '';
|
||||
},
|
||||
];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue