post by phamtungvnp on Oct 9, 2023

Can you help me how to insert date values into the database? For example, today is October 9, 2023 but I want to select the value October 20, 2023 into the database, what should I do? While in Grocery CRUD Enterprise, the add form does not allow datepicker input, giving me a choice as shown in the attached image.

post by johnny on Oct 10, 2023

Hello @phamtungvnp ,

Can you send us the function on your Controller that you use? Date fields should work out of the box. Also maybe try fieldType to add native_date instead?

Regards
Johnny

post by phamtungvnp on Oct 10, 2023

post by johnny on Oct 11, 2023

Hello @phamtungvnp ,

Seems that you are missing the fieldType from what I see from your code. For example:

$crud->fieldType('ngaynhan_dukien', 'datetime');

If this still doesn’t work for you then try:

$crud->fieldType('ngaynhan_dukien', 'native_datetime');

Regards
Johnny

post by phamtungvnp on Oct 11, 2023

1 / 5
Oct 2023