summaryrefslogtreecommitdiff
path: root/includes/common.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/common.inc')
-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;
}