Hello ,
My issue is, if I am selecting start time from the dropdown as 10:15 am and end time as 1:05 pm. Then system is considering that, 10 is greater than 1. What should I do? My activity plugin is based on time only.
Below is the code:
mod_form.php
//start date time
$mform->addElement('date_time_selector', 'startdt', get_string('sdat','tgwhiteboard'));
$mform->setDefault('startdt', $tgwhiteboard->tg_start_datetime);
$mform->addRule('startdt', null, 'required', null, 'client');
//enddate time
$mform->addElement('date_time_selector', 'enddt', get_string('edat','tgwhiteboard'));
$mform->setDefault('enddt', $tgwhiteboard->tg_end_datetime);
$mform->addRule('enddt', null, 'required', null, 'client');
view.php
//getting all the details from db (stored in variable named, $livesessiondetails)
//1561549800 -- like this
$session_start = date('Y-m-d h:i', $livesessiondetails->tg_start_datetime);
$session_end = date('Y-m-d h:i', $livesessiondetails->tg_end_datetime);
//to start the session before 15 minutes
$start_time = strtotime($session_start);
$start_time = $start_time - (15 * 60);
$start_time = date("Y-m-d h:i", $start_time);
//to add extra 15 minutes into the session
$end_time = strtotime($session_end);
$end_time = $end_time + (15 * 60);
$end_time = date("Y-m-d h:i", $end_time);