Index: date_api.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/date/date_api.module,v retrieving revision 1.64.2.5.2.60 diff -u -p -r1.64.2.5.2.60 date_api.module --- date_api.module 25 Jan 2009 13:03:12 -0000 1.64.2.5.2.60 +++ date_api.module 10 Feb 2009 15:00:34 -0000 @@ -29,6 +29,7 @@ define('DATE_FORMAT_ISO', "Y-m-d\TH:i:s" define('DATE_FORMAT_UNIX', "U"); define('DATE_FORMAT_DATETIME', "Y-m-d H:i:s"); define('DATE_FORMAT_ICAL', "Ymd\THis"); +define('DATE_FORMAT_ICAL_DATE', "Ymd"); define('DATE_FORMAT_DATE', 'Y-m-d'); define('DATE_REGEX_ISO', '/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):?(\d{2})?/'); Index: date/date.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/date/date/date.module,v retrieving revision 1.61.2.4.2.46 diff -u -p -r1.61.2.4.2.46 date.module --- date/date.module 25 Jan 2009 13:03:13 -0000 1.61.2.4.2.46 +++ date/date.module 10 Feb 2009 15:00:35 -0000 @@ -441,6 +441,10 @@ function date_field($op, &$node, $field, $additions[$field['field_name']][$delta]['timezone'] = date_get_timezone($field['tz_handling'], $timezone); $additions[$field['field_name']][$delta]['timezone_db'] = date_get_timezone_db($field['tz_handling']); $additions[$field['field_name']][$delta]['date_type'] = $field['type']; + if (strpos($item['value'], 'f') == (strlen($item['value']) - 1)) { + $item['fullday'] = TRUE; + $additions[$field['field_name']][$delta]['fullday'] = TRUE; + } } switch ($op) { case 'load': Index: date/date_admin.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/date/date/date_admin.inc,v retrieving revision 1.40.2.3.2.30 diff -u -p -r1.40.2.3.2.30 date_admin.inc --- date/date_admin.inc 25 Jan 2009 13:03:13 -0000 1.40.2.3.2.30 +++ date/date_admin.inc 10 Feb 2009 15:00:35 -0000 @@ -245,7 +245,7 @@ function _date_field_settings($op, $fiel 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', 'fullday'); return $options; case 'database columns': @@ -316,6 +316,7 @@ function date_field_settings_form($field $granularity = array('year', 'month', 'day', 'hour', 'minute'); } $tz_handling = isset($field['tz_handling']) ? $field['tz_handling'] : (date_has_time($granularity) ? 'site' : 'none'); + $fullday = isset($field['fullday']) ? $field['fullday'] : 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)) { @@ -362,6 +363,12 @@ function date_field_settings_form($field '#options' => date_timezone_handling_options(), '#description' => $description, ); + $form['fullday'] = array( + '#type' => 'checkbox', + '#title' => t('Full-day checkbox'), + '#default_value' => $fullday, + '#description' => t('If turned on, full-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: date/date_elements.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/date/date/date_elements.inc,v retrieving revision 1.46.2.2.2.44 diff -u -p -r1.46.2.2.2.44 date_elements.inc --- date/date_elements.inc 13 Jan 2009 13:49:05 -0000 1.46.2.2.2.44 +++ date/date_elements.inc 10 Feb 2009 15:00:35 -0000 @@ -80,6 +80,12 @@ function _date_field_update($op, &$node, $items[$delta]['value2'] = date_limit_value($items[$delta]['value2'], date_granularity($field), $field['type']); } } + if ($item['fullday'] == TRUE) { + $items[$delta]['value'] = $items[$delta]['value'] .'f'; + if ($field['todate']) { + $items[$delta]['value2'] = $items[$delta]['value2'] .'f'; + } + } } $node->$field['field_name'] = $items; } @@ -132,6 +138,7 @@ function _date_widget(&$form, &$form_sta require_once('./'. drupal_get_path('module', 'date_api') .'/date_api_elements.inc'); $timezone = date_get_timezone($field['tz_handling'], isset($items[0]['timezone']) ? $items[0]['timezone'] : date_default_timezone_name()); + $fullday_item = (strpos($items[0]['value'], 'f') == (strlen($items[0]['value']) - 1)); // TODO see if there's a way to keep the timezone element from ever being // nested as array('timezone' => 'timezone' => value)). After struggling // with this a while, I can find no way to get it displayed in the form @@ -182,6 +189,15 @@ function _date_widget(&$form, &$form_sta _date_repeat_widget($element, $field, $items, $delta); $element['rrule']['#weight'] = $field['widget']['weight'] + .4; } + if ($field['fullday'] == TRUE) { + $element['fullday'] = array( + '#title' => t('Full-day'), + '#type' => 'checkbox', + '#delta' => $delta, + '#default_value' => $fullday_item, + '#description' => t('Turn on if the date is full-day.') + ); + } return $element; } Index: theme/theme.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/date/theme/Attic/theme.inc,v retrieving revision 1.1.4.29 diff -u -p -r1.1.4.29 theme.inc --- theme/theme.inc 3 Dec 2008 15:44:27 -0000 1.1.4.29 +++ theme/theme.inc 10 Feb 2009 15:00:35 -0000 @@ -144,7 +144,9 @@ function template_preprocess_date_vcalen // Format the event results as iCal expects. $events_in = $vars['events']; $events = array(); + $rows = $vars['rows']; foreach ($events_in as $uid => $event) { + $row = array_shift($rows); // Omit any items with empty dates. if (!empty($event['start'])) { $events[$uid] = $event; @@ -155,9 +157,11 @@ function template_preprocess_date_vcalen else { $events[$uid]['timezone'] = ''; } - $events[$uid]['start'] = date_format($event['start'], DATE_FORMAT_ICAL); + $date_format = ($row->calendar_all_day == TRUE) ? DATE_FORMAT_ICAL_DATE : DATE_FORMAT_ICAL; + $date_format = ($row->calendar_fullday == TRUE) ? DATE_FORMAT_ICAL_DATE : DATE_FORMAT_ICAL; + $events[$uid]['start'] = date_format($event['start'], $date_format); if ($event['start'] && $event['end']) { - $events[$uid]['end'] = date_format($event['end'], DATE_FORMAT_ICAL); + $events[$uid]['end'] = date_format($event['end'], $date_format); } else { $events[$uid]['end'] = $events[$uid]['start'];