SleepingOwlAdmin
SleepingOwlAdmin copied to clipboard
Date editor inside hasMany is broken
Admin/models.php:
AdminFormElement::hasMany( 'catering_dates', [ AdminFormElement::date( 'date', 'Date' ), AdminFormElement::text( 'details', 'Details' ), ]),
config/sleeping_owl.php
'dateFormat' => 'd.m.Y',
2 issues:
- When you add a new row at this section, the date picker is not initialized
- When you save the existing date (say 1.03.2021), it crashes due to incorrect date format (checked code, and at hasMany save handler you don't account for date format)
Workaround: changed dateFormat to 'Y-m-d'
I checked dev-development, it behaves the same way...
I will gladly accept PR for consideration) Alas, I don’t deal with this functionality, maybe later.
use ->setPickerFormat('d-m-Y')