SleepingOwlAdmin icon indicating copy to clipboard operation
SleepingOwlAdmin copied to clipboard

Date editor inside hasMany is broken

Open eugenem opened this issue 3 years ago • 1 comments

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:

  1. When you add a new row at this section, the date picker is not initialized
  2. 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...

eugenem avatar Feb 28 '21 23:02 eugenem

I will gladly accept PR for consideration) Alas, I don’t deal with this functionality, maybe later.

daaner avatar May 14 '21 00:05 daaner

use ->setPickerFormat('d-m-Y')

daaner avatar Nov 08 '23 00:11 daaner