$crud->fields('field1','field2','field3','field4'); $crud->field_type('field1', 'hidden'); $crud->field_type('field2', 'hidden'); //$crud->field_type('field3', 'date'); $crud->field_type('field4', 'hidden');
when editing a record,
where "field3" is of type date, I put the value: 2013-08-02
but to make a callback_before_update in post_array ['field3'] is saved: 02/08/2013, rather than: 2013-08-02
I think it is because I put the other fields, hidden type
I solved it in the callback_before_update adding:
$date_array = preg_split( '/[-\.\/ ]/', post_array['field3']); post_array['field3'] = date('Y-m-d',mktime(0,0,0,$date_array[1],$date_array[0],$date_array[2])); return $post_array;
I think the library grocery_crud.php, has a small bug on this.
perhaps somewhere, does not run the function: _convert_date_to_sql_date($date)
regards