Hi there,
I’m trying to use the now
default in a date field to set the current date and time:
published:
label: Published on
type: date
time: true
default: now
However, I am also extending the date field in a plugin to give it a certain default value like so:
Kirby::plugin('trych/field-defaults', [
'fields' => [
'date' => [
'extends' => 'date',
'props' => [
'display' => fn($value = 'DD.MM.YYYY') => $value
]
]
]
]);
As soon as I do this, the now
keyword stops taking effect and the field value ends up being literally now
instead of the current date. Does anybody know how I could prevent this and have the now
keyword still working?
Thanks!