In the file 'lib.php' inside my course format folder, i had added in courseformatoptionsedit array this code.
'enddate' => array(
'label' => new lang_string('end_date'),
'element_type' => 'date_selector',
),
With this code, a date fieldset is rendered in the course format section with the default value of today. If i choose a date and save the course, it is correctly saved in the mdl_course_format_options table a timestamp for the day in the fieldset.
moodle_devel=> select * from mdl_course_format_options WHERE courseid = '220';
id | courseid | format | sectionid | name | value
-----+----------+----------------+-----------+----------------+------------
982 | 220 | topicsunivates | 0 | enddate | 1456887600
685 | 220 | topicsunivates | 0 | numsections | 18
686 | 220 | topicsunivates | 0 | hiddensections | 0
687 | 220 | topicsunivates | 0 | coursedisplay | 0
(4 rows)
#In this case the date was 02/03/2016 (dd/mm/yyyy)
Until now ok. But when i enter in edit again, the fieldset are rendered with the today date, ignoring the value on the database.
What can i do to get the fieldset filled with the correct value(the one in the database).
Thanks!
OBS:. I tried with 'element_type' => 'text', and it works correctly.