2020-02-23, 10:36 PM
There is a method in the DefaultForm class, generate_date_select, which is used to generate a date selection. However, there is no function to generate date + time inputs. In a plugin I'm working on, I created such a function that uses the "date" and "time" inputs.
Could something similar be implemented into MyBB?
require_once MYBB_ROOT . "cgdadmin/inc/class_form.php";
/**
* Workaround for a method that doesn't exist in the DefaultForm class
*/
class ModifiedForm extends DefaultForm {
function generate_datetime_field($name, $date="", $time="") {
return "<input type=\"date\" name=\"" . $name . "_date\" id=\"" . $name . "_date\" value=\"" . $date . "\" />
<input type=\"time\" id=\"" . $name . "_time\" name=\"" . $name . "_time\" value=\"" . $time . "\"";
}
}
Could something similar be implemented into MyBB?