diff options
author | Jim Hu <jimhu@users.sourceforge.net> | 2008-12-26 19:32:41 +0000 |
---|---|---|
committer | Jim Hu <jimhu@users.sourceforge.net> | 2008-12-26 19:32:41 +0000 |
commit | b4d635e784aa5589a34d3bbadaf3e93482fa4d33 (patch) | |
tree | 456daf290e674c99ebaa313325882f5b2c065b71 /functions | |
parent | 65c00ba1223eb97ff618fd661402a74c037c58cd (diff) | |
download | phpicalendar-b4d635e784aa5589a34d3bbadaf3e93482fa4d33.tar.gz phpicalendar-b4d635e784aa5589a34d3bbadaf3e93482fa4d33.tar.bz2 phpicalendar-b4d635e784aa5589a34d3bbadaf3e93482fa4d33.zip |
update danish
Diffstat (limited to 'functions')
-rw-r--r-- | functions/date_functions.php | 20 | ||||
-rw-r--r-- | functions/parse/recur_functions.php | 1 |
2 files changed, 12 insertions, 9 deletions
diff --git a/functions/date_functions.php b/functions/date_functions.php index 5239279..96e0c75 100644 --- a/functions/date_functions.php +++ b/functions/date_functions.php @@ -107,15 +107,17 @@ function localizeDate($format, $timestamp) { $year = date("Y", $timestamp); $month = date("n", $timestamp)-1; $day = date("j", $timestamp); - $dayofweek = date("w", $timestamp); - - $date = str_replace('%Y', $year, $format); - $date = str_replace('%e', $day, $date); - $date = str_replace('%B', $monthsofyear_lang[$month], $date); - $date = str_replace('%b', $monthsofyearshort_lang[$month], $date); - $date = str_replace('%A', $daysofweek_lang[$dayofweek], $date); - $date = str_replace('%a', $daysofweekshort_lang[$dayofweek], $date); - + $dayofweek = date("w", $timestamp); + $replacements = array( + '%Y' => $year, + '%e' => $day, + '%B' => $monthsofyear_lang[$month], + '%b' => $monthsofyearshort_lang[$month], + '%A' => $daysofweek_lang[$dayofweek], + '%a' => $daysofweekshort_lang[$dayofweek], + '%d' => sprintf("%02d", $day) + ); + $date = str_replace(array_keys($replacements), array_values($replacements), $format); return $date; } diff --git a/functions/parse/recur_functions.php b/functions/parse/recur_functions.php index 8daa71d..0526e1d 100644 --- a/functions/parse/recur_functions.php +++ b/functions/parse/recur_functions.php @@ -34,6 +34,7 @@ function add_recur($times,$freq=''){ # These are already fixed for the initial instance, but need to be fixed for recurrences if (date("Ymd", $time) != $start_date) $time = $time + $day_offset * (24*60*60); if(isset($time) + && $time != '' && !in_array($time, $recur_data) && !in_array($date, $except_dates) && $time >= $start_date_unixtime |