Index: contributions/modules/date/date/date_admin.inc --- contributions/modules/date/date/date_admin.inc Base (1.40.2.3.2.39) +++ contributions/modules/date/date/date_admin.inc Locally Modified (Based On 1.40.2.3.2.39) @@ -245,7 +245,7 @@ case 'save': - $options = array('granularity', 'timezone_db', 'tz_handling', 'todate', 'repeat', 'repeat_collapsed', 'default_format'); + $options = array('granularity', 'timezone_db', 'tz_handling', 'todate', 'repeat', 'repeat_collapsed', 'default_format', 'all_day'); return $options; case 'database columns': @@ -316,6 +316,9 @@ $db_columns['offset'] = array('type' => 'int', 'not null' => FALSE, 'sortable' => TRUE, 'views' => FALSE); if (!empty($field['todate'])) $db_columns['offset2'] = array('type' => 'int', 'not null' => FALSE, 'sortable' => TRUE, 'views' => FALSE); } + if (isset($field['all_day']) && $field['all_day'] == TRUE) { + $db_columns['all_day'] = array('type' => 'int', 'length' => 1, 'not null' => FALSE, 'sortable' => FALSE); + } if (isset($field['repeat']) && $field['repeat'] == 1) { $db_columns['rrule'] = array('type' => 'text', 'not null' => FALSE, 'sortable' => FALSE, 'views' => FALSE); } @@ -334,6 +337,7 @@ $granularity = array('year', 'month', 'day', 'hour', 'minute'); } $tz_handling = isset($field['tz_handling']) ? $field['tz_handling'] : (date_has_time($granularity) ? 'site' : 'none'); + $all_day = isset($field['all_day']) ? $field['all_day'] : FALSE; // If adding a repeat, override the Content module's handling of the multiple values option. if (module_exists('date_repeat') && date_is_repeat_field($field)) { @@ -380,6 +384,12 @@ '#options' => date_timezone_handling_options(), '#description' => $description, ); + $form['all_day'] = array( + '#type' => 'checkbox', + '#title' => t('All-day checkbox'), + '#default_value' => $all_day, + '#description' => t('If turned on, all-day property of the dates can be handled.'), + ); // Force this value to hidden because we don't want to allow it to be changed right now, // but allow it to be a variable if needed. $form['timezone_db'] = array( Index: contributions/modules/date/date/date_elements.inc --- contributions/modules/date/date/date_elements.inc Base (1.46.2.2.2.66) +++ contributions/modules/date/date/date_elements.inc Locally Modified (Based On 1.46.2.2.2.66) @@ -55,6 +55,13 @@ $values = $items; foreach ($values as $delta => $item) { + if ($item['all_day'] == TRUE) { + $items[$delta]['value'] = date(DATE_FORMAT_DATE, strtotime($items[$delta]['value'])); + if ($field['todate']) { + $items[$delta]['value2'] = date(DATE_FORMAT_DATE, strtotime($items[$delta]['value2'])); + } + } + // Special case for ISO dates which may have been given artificial values for // some date parts to make them into valid dates. if (!empty($item['value']) && $field['type'] == DATE_ISO) { @@ -165,6 +172,17 @@ _date_repeat_widget($element, $field, $items, $delta); $element['rrule']['#weight'] = $field['widget']['weight'] + .4; } + + if ($field['all_day'] == TRUE) { + $element['all_day'] = array( + '#title' => t('All-day'), + '#type' => 'checkbox', + '#delta' => $delta, + '#default_value' => $items[$delta]['all_day'], + '#description' => t('Turn on if the date is all-day.'), + ); + } + return $element; } Index: contributions/modules/date/theme/theme.inc --- contributions/modules/date/theme/theme.inc Base (1.1.4.36) +++ contributions/modules/date/theme/theme.inc Locally Modified (Based On 1.1.4.36) @@ -188,6 +188,9 @@ $events[$uid]['timezone'] = ''; } $date_format = ($row->calendar_all_day == TRUE) ? DATE_FORMAT_ICAL_DATE : DATE_FORMAT_ICAL; + if ($event['end'] && $row->calendar_all_day == TRUE){ + $event['end']->modify("+1 day"); + } $events[$uid]['start'] = date_format($event['start'], $date_format); if ($event['start'] && $event['end']) { $events[$uid]['end'] = date_format($event['end'], $date_format);