From 73d433f17d349cb2a3c8084d4ac5cecf650afb04 Mon Sep 17 00:00:00 2001 From: Jim Hu Date: Wed, 7 Jan 2009 20:20:03 +0000 Subject: timeformat serialization needed urlencode/decode? --- functions/date_functions.php | 2 ++ functions/init/configs.php | 14 +++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'functions') diff --git a/functions/date_functions.php b/functions/date_functions.php index 931e613..74e428e 100644 --- a/functions/date_functions.php +++ b/functions/date_functions.php @@ -98,6 +98,7 @@ function localizeDate($format, $timestamp) { $month = date("n", $timestamp)-1; $day = date("j", $timestamp); $dayofweek = date("w", $timestamp); + $weeknumber = date("W", $timestamp); $replacements = array( '%Y' => $year, '%e' => $day, @@ -105,6 +106,7 @@ function localizeDate($format, $timestamp) { '%b' => $monthsofyearshort_lang[$month], '%A' => $daysofweek_lang[$dayofweek], '%a' => $daysofweekshort_lang[$dayofweek], + '%W' => $weeknumber, '%d' => sprintf("%02d", $day) ); $date = str_replace(array_keys($replacements), array_values($replacements), $format); diff --git a/functions/init/configs.php b/functions/init/configs.php index d441168..c73688f 100644 --- a/functions/init/configs.php +++ b/functions/init/configs.php @@ -40,7 +40,7 @@ if (isset($_COOKIE[$cookie_name]) && !isset($_POST['unset']) && $current_view != } if (isset($phpicalendar['cookie_startday'])) $phpiCal_config->setProperty('week_start_day', $phpicalendar['cookie_startday']); if (isset($phpicalendar['cookie_time'])) $phpiCal_config->setProperty('day_start', $phpicalendar['cookie_time']); - if (isset($phpicalendar['cookie_endtime'])) $phpiCal_config->setProperty('day_end', $phpicalendar['cookie_endtime']); + if (isset($phpicalendar['cookie_endtime'])) $phpiCal_config->setProperty('day_end', $phpicalendar['cookie_endtime']); if (isset($phpicalendar['cookie_timezone'])) $phpiCal_config->setProperty('timezone', $phpicalendar['cookie_timezone']); } @@ -55,7 +55,7 @@ if (is_file($lang_file)) { } if (isset($phpicalendar['cookie_timeformat']) && $phpicalendar['cookie_timeformat'] !=''){ - $timeFormat = $phpicalendar['cookie_timeformat']; + $timeFormat = urldecode($phpicalendar['cookie_timeformat']); switch($timeFormat){ case 'h:i': case 'h:i A': @@ -89,11 +89,11 @@ while ($fillTime < $phpiCal_config->day_end) { } if (!isset($current_view)) $current_view = $phpiCal_config->default_view; - +/* $tz_array=array(); -#echo "
xx";
+echo "
xx";
 #print_r($configs);
-#print_r($phpicalendar);
-#print_r($phpiCal_config);
-#echo "
"; +print_r($phpiCal_config); +echo "
"; #die; +*/ \ No newline at end of file -- cgit v1.2.3