I have a question, I created a date field, which will automatically updated. it has the following structure.
config/grocery_crud.php
$config['grocery_crud_default_language'] = 'pt-pt.portuguese'; // There are only three choices: "uk-date" (dd/mm/yyyy), "us-date" (mm/dd/yyyy) or "sql-date" (yyyy-mm-dd) $config['grocery_crud_date_format'] = 'uk-date';
controllers/seg
$crud->set_table('seguradoras'); $crud->columns('dataInscricao'); $crud->fields('dataInscricao'); $crud->change_field_type('dataInscricao','hidden'); $crud->callback_before_insert(array($this,'callback_insert')); $crud->callback_before_update(array($this,'callback_update')); function callback_insert($post_array) { $post_array['dataInscricao'] = date('d-m-Y H:i:s'); $post_array['dataInscricao'] = date('d-m-Y H:i:s'); return $post_array; } function callback_update($post_array) { $post_array['dataInscricao'] = date('d-m-Y H:i:s'); return $post_array; }
However he accepts not registering the date on bench with d-m-Y format, only with Y-m-d.
Does anyone know the solution to this
he is just not loading the data adds
2014-02-22 23:12:13
But the idea is thus shown that
22-02-2014 23:12:13