diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 36e3ce3141ac860a6080b3b30b7138c42aa347ac..e18d220a38db283820fe7282754b2a1ac9af655c 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,6 +6,7 @@ Version 7.x-2.x-dev =================== - Issue #1209026, When date validation fails, Date Popup value is getting cleared. +- 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 27df5f51f0af755c618588506d6f360ec554f05e..a4cad56ea43831fffa2d2d31513900493a89a965 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); + } /**