From defad8cdefc326e04f38b78edb98952508bce1b6 Mon Sep 17 00:00:00 2001 From: Manuel Cillero Date: Wed, 26 Jul 2017 20:22:46 +0200 Subject: [PATCH] Solved visualization problem with events and shorted 'Change date' button label --- sites/all/modules/calendar/calendar.module | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sites/all/modules/calendar/calendar.module b/sites/all/modules/calendar/calendar.module index aa83ed1..a152511 100644 --- a/sites/all/modules/calendar/calendar.module +++ b/sites/all/modules/calendar/calendar.module @@ -383,7 +383,7 @@ function calendar_date_select_form(&$form_state, $view) { ); $form['submit'] = array( '#type' => 'submit', - '#value' => t('Change date'), + '#value' => t('Go'), ); return $form; } @@ -873,16 +873,16 @@ function calendar_build_nodes(&$view, &$items) { $node->calendar_start = date_format($node->calendar_start_date, DATE_FORMAT_DATETIME); $node->calendar_end = date_format($node->calendar_end_date, DATE_FORMAT_DATETIME); - if (substr($real_field, 0, 9) == 'field_') { + if (substr($real_field, 0, 6) == 'field_') { $cck_field = content_fields($cck_field_name); - $granularity = $cck_field['granularity']; + $granularity = is_array($cck_field['granularity']) ? end($cck_field['granularity']) : $cck_field['granularity']; $increment = $cck_field['widget']['increment']; } else { $granularity = 'second'; $increment = 1; } - $node->calendar_all_day = date_is_all_day($node->calendar_end, $node->calendar_end, $granularity, $increment); + $node->calendar_all_day = $granularity == 'day' ? TRUE : date_is_all_day($node->calendar_start, $node->calendar_end, $granularity, $increment); // Flag all day values specifically set in date. $all_day_field = str_replace(array('_value2', '_value'), '_all_day', $node->datefield); @@ -918,4 +918,4 @@ function calendar_build_nodes(&$view, &$items) { } } return $nodes; -} \ No newline at end of file +}