Failed Date When Viewed in Web Page

63 views
Skip to first unread message

Hary Mulyadi

unread,
Jan 22, 2013, 4:04:34 AM1/22/13
to jquer...@googlegroups.com
Hi all, 
I did some gantt char coding which input from json file. But, the viewed date is not matching with the input given. You can check this out.

Here is the code for input data in php file server: 
foreach ($result as $key0 => $value0) {
foreach ($value0 as $key1 => $value1) {
$tempObjArr["id"] = strval($i);
$from=$value1["start_date"];
list($year, $month, $day) = explode("-", $from); 
$from = mktime(0, 0,0, $month, $day, $year);
$tempObjArr["from"] = "/Date(".$from.")/";
$to=$value1['end_date'];
list($year, $month, $day) = explode("-", $to);  
$to = mktime(0, 0, 0, $month, $day, $year);
$tempObjArr["to"] = "/Date(".$to.")/";
$tempObjArr["desc"] = " "; //$value1['description'];
$tempObjArr["label"] = "WP #".strval($i);
$tempObjArr["customClass"] = "ganttRed";
$work_pack["name"] = $value1["name"];
$work_pack["desc"] = "";
$tempArr[] = $tempObjArr;
$work_pack["values"] = $tempArr;
}
$output[] = $work_pack;

Here is the result, viewed in web page:

And here is the debugging data:


You can see, until debugging data, the date was valid. It mush be show in year 2012. But, when viewed in web page it was failed, it's showed in year 1970.

Perhaps, you have any solution, I'm very appreciate for that. Thanks.

Regards,
Hary
Reply all
Reply to author
Forward
0 new messages