Scheduler time date


Okay figured out the first question but now for the second.  I am having problems inserting the event here is what I have:



function doBeforeProcessing($action){
  global $scheduler;
  
  $status = $action->get_status();
    $date1 = $action->get_value(“date_start”);
  $split = explode(" “,$date1);  
  $action->set_value(“starttime”,‘$split[1]’);
  $date2 = $action->get_value(“date_end”);
  $split2 = explode(” ",$date2);
 $action->set_value(“endtime”,‘$split2[1]’);
  $subject = $action->get_value(“text”);
  $action->set_value(“type”, “EV”);
  if ($status == “insert” ){
   $scheduler->sql->query(“INSERT INTO notes (startdate,enddate,starttime,endtime,subject,type) VALUES (‘{$date1}’,‘{$date2}’,‘{$time1}’,‘{$time2}’,‘{$subject}’),‘{$type}’”);
   $action->success();
  }
   
 } 


You can try to replace


$date1 = $action->get_value(“date_start”); with $date1 = $action->get_value(“datestart”);


and


$date2 = $action->get_value(“date_end”); with $date2 = $action->get_value(“dateend”);