From b4d635e784aa5589a34d3bbadaf3e93482fa4d33 Mon Sep 17 00:00:00 2001 From: Jim Hu Date: Fri, 26 Dec 2008 19:32:41 +0000 Subject: update danish --- functions/date_functions.php | 20 +++++++++++--------- functions/parse/recur_functions.php | 1 + 2 files changed, 12 insertions(+), 9 deletions(-) (limited to 'functions') 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 -- cgit v1.2.3