summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2003-09-29 18:20:38 +0000
committerDries Buytaert <dries@buytaert.net>2003-09-29 18:20:38 +0000
commitd80140b442fd233c80ca79e128a41c5874b77bee (patch)
treeaf7d85c226faf7a8a63267b97eb182ee0cc51750
parent9a0573a8e1c3427ac9e1a607fde3dc15f8f9d3a1 (diff)
downloadbrdo-d80140b442fd233c80ca79e128a41c5874b77bee.tar.gz
brdo-d80140b442fd233c80ca79e128a41c5874b77bee.tar.bz2
- Made sure dates can be translated nicely. Patch by Gobar.
-rw-r--r--includes/common.inc34
1 files changed, 17 insertions, 17 deletions
diff --git a/includes/common.inc b/includes/common.inc
index e26929300..a88bb10b6 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -907,29 +907,29 @@ function format_date($timestamp, $type = "medium", $format = "") {
switch ($type) {
case "small":
- $date = date(variable_get("date_format_short", "m/d/Y - H:i"), $timestamp);
- break;
- case "medium":
- $date = date(variable_get("date_format_medium", "D, m/d/Y - H:i"), $timestamp);
+ $format = variable_get("date_format_short", "m/d/Y - H:i");
break;
case "large":
- $date = date(variable_get("date_format_long", "l, F j, Y - H:i"), $timestamp);
+ $format = variable_get("date_format_long", "l, F j, Y - H:i");
break;
case "custom":
- for ($i = strlen($format); $i >= 0; $c = $format[--$i]) {
- if (strstr("DFlMSw", $c)) {
- $date = t(date($c, $timestamp)) . $date;
- }
- else if (strstr("AaBdgGhHiIjLmnOrstTUWYyZz", $c)) {
- $date = date($c, $timestamp) . $date;
- }
- else {
- $date = $c.$date;
- }
- }
+ // No change to format
break;
+ case "medium":
default:
- $date = date(variable_get("date_format_medium", "l, m/d/Y - H:i"), $timestamp);
+ $format = variable_get("date_format_medium", "D, m/d/Y - H:i");
+ }
+
+ for ($i = strlen($format); $i >= 0; $c = $format[--$i]) {
+ if (strstr("DFlMSw", $c)) {
+ $date = t(date($c, $timestamp)) . $date;
+ }
+ else if (strstr("AaBdgGhHiIjLmnOrstTUWYyZz", $c)) {
+ $date = date($c, $timestamp) . $date;
+ }
+ else {
+ $date = $c.$date;
+ }
}
return $date;
}