Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Stan on Oct 22, 2009 09:24
open dhtmlx forum
Scheduler Date Time

Ok, here is what I have and It renders only the date:

function doBeforeRender($data){
    $temp1 = $data->get_value("startdate");
    $temp2 = $data->get_value("starttime");  
    $data->set_value("start_date",$temp1." ".$temp2);
    $temp3 = $data->get_value("enddate");
    $temp4 = $data->get_value("endtime");
    $data->set_value("end_date",$temp3." ".$temp4);
 }

$scheduler = new schedulerConnector($res);

$scheduler->event->attach("beforeRender",doBeforeRender);

$scheduler->render_sql("SELECT `id`, `startdate`, `starttime`, `enddate`, `endtime`, `subject`  FROM `notes` WHERE type = 'EV'","id","startdate,enddate,subject","starttime,endtime","");

- <data>
- <event id="511">
- <start_date>
<![CDATA[
2009-10-02
  ]]>
  </start_date>
- <end_date>
<![CDATA[
2009-10-02
  ]]>
  </end_date>
- <text>
<![CDATA[
Christie Spencer - dispense
  ]]>
  </text>
  </event>
- <event id="512">
- <start_date>
<![CDATA[
2009-10-02
  ]]>
  </start_date>
- <end_date>
<![CDATA[
2009-10-02
  ]]>
  </end_date>
- <text>
<![CDATA[
Harper  - CL Dispense
  ]]>
  </text>
  </event>

 

 

Answer posted by Alex (support) on Oct 23, 2009 01:52

There is the issue in the set_value calls: Try to use startdate and enddate instead of start_date and end_date here:

function doBeforeRender($data){
  $temp1 = $data->get_value("startdate");
  $temp2 = $data->get_value("starttime");  
  $data->set_value("startdate",$temp1." ".$temp2);
  $temp3 = $data->get_value("enddate");
  $temp4 = $data->get_value("endtime");
  $data->set_value("enddate",$temp3." ".$temp4);
}