It looks like you're new here. If you want to get involved, click one of these buttons!
Hi,
in my Events_model I need to display the weekday name next to the datepicker.
I kind of expected it will all happen magically if I set the date_format
'D, d.m.Y', to get Mon, 28.08.2019
public function form_fields($values = array(), $related = array())
{
$fields['start_date']['label'] = 'Datum von';
$fields['start_date']['date_format'] = 'D, d.m.Y';
$fields['end_date']['label'] = 'Datum bis';
$fields['end_date']['date_format'] = 'D, d.m.Y';
}
It's shown correctly in the start_date field but not in the end_date field and saving the field makes problems as well.
Do I need to transform those fields myself, before saving?
I checked the values in function on_before_clean($values)
where they appear in the D, d.m.Y format, but in public function on_before_save($values)
$values['start_date']
is null
. So somehow, something gets lost in between, and I can't make any sense of it.
I appreciate any hint.
Comments
I guess I have to prepare and reformat the fields myself. This did it for me:
If there is a built-in way, let me know. Thanks!
That would be the way to do it at this time.
Ok, cool! Thanks for confirming.