summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorarlinsandbulte2012-01-29 00:18:20 (GMT)
committer arlinsandbulte2012-01-29 00:18:20 (GMT)
commita7490ab9840d09aa478cc74306b51a56c51e8fde (patch)
tree78d54699e525b94f082166ae938a29593c746b0b
parentbb1ab618a57517d0b57c30e00793a2a3ad09e39f (diff)
Issue #1017216 by tim.plunkett, arlinsandbulte: Added custom date format without time shows 'all day'.
-rw-r--r--CHANGELOG.txt2
-rw-r--r--date_all_day/date_all_day.module27
2 files changed, 14 insertions, 15 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 98b6a34..0dca3f7 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -4,7 +4,7 @@ Date Module 7.x
===================
Version 7.x-2.x-dev
===================
-
+- Issue #1017216 by tim.plunkett, arlinsandbulte: Added custom date format without time shows 'all day'.
- Issue #1408014 by dasjo, We no longer need the $error_element value to display errors properly.
======================
diff --git a/date_all_day/date_all_day.module b/date_all_day/date_all_day.module
index 27df5f5..a4cad56 100644
--- a/date_all_day/date_all_day.module
+++ b/date_all_day/date_all_day.module
@@ -117,26 +117,25 @@ function theme_date_all_day($vars) {
$date2 = $date1;
}
+ $suffix = '';
if (!date_has_time($field['settings']['granularity'])) {
$format = date_limit_format($format, array('year', 'month', 'day'));
- return date_format_date($$which, 'custom', $format);
- }
-
- $format_granularity = date_format_order($format);
- $format_has_time = FALSE;
- if (in_array('hour', $format_granularity)) {
- $format_has_time = TRUE;
- }
- $all_day = date_all_day_field($field, $instance, $date1, $date2);
-
- if ($all_day && $format_has_time) {
- $format = date_limit_format($format, array('year', 'month', 'day'));
- return trim(date_format_date($$which, 'custom', $format) .' '. theme('date_all_day_label'));
}
else {
- return date_format_date($$which, 'custom', $format);
+ $format_granularity = date_format_order($format);
+ $format_has_time = FALSE;
+ if (in_array('hour', $format_granularity)) {
+ $format_has_time = TRUE;
+ }
+ $all_day = date_all_day_field($field, $instance, $date1, $date2);
+ if ($all_day && $format_has_time) {
+ $format = date_limit_format($format, array('year', 'month', 'day'));
+ $suffix = ' ' . theme('date_all_day_label');
+ }
}
+ return trim(date_format_date($$which, 'custom', $format) . $suffix);
+
}
/**