fix daylong error

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3297 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
haneul 2007-12-10 13:17:23 +00:00
parent 03ffc760b2
commit 70a6df5871

View file

@ -27,10 +27,10 @@
$this->setTemplatePath($template_path); $this->setTemplatePath($template_path);
} }
function dateFormatChange($dates) { function dateFormatChange($dates, $plus = 0) {
$dates = str_replace( "T", " ", $dates); $dates = str_replace( "T", " ", $dates);
$dates = str_replace( "Z", "+0", $dates); $dates = str_replace( "Z", "+0", $dates);
$dates = date("Y-m-d H:i:s", strtotime($dates)); $dates = date("Y-m-d H:i:s", strtotime($dates) + $plus);
return $dates; return $dates;
} }
@ -57,7 +57,10 @@
} }
if($val->childNodes["date-end"]) if($val->childNodes["date-end"])
{ {
$val->childNodes["date-end"]->body = $this->dateFormatChange($val->childNodes["date-end"]->body); $plus = 0;
if($val->childNodes["type"]->body == "daylong")
$plus = -1;
$val->childNodes["date-end"]->body = $this->dateFormatChange($val->childNodes["date-end"]->body, $plus);
} }
} }