Using last version available in -dev
This commit is contained in:
parent
f697b66461
commit
d12eba903d
1 changed files with 72 additions and 63 deletions
|
@ -36,6 +36,9 @@ function template_preprocess_calendar_main(&$vars) {
|
||||||
else {
|
else {
|
||||||
$current_date = date_make_date($view->date_info->year .'-01-01 00:00:00');
|
$current_date = date_make_date($view->date_info->year .'-01-01 00:00:00');
|
||||||
}
|
}
|
||||||
|
$ww = date_day_of_week($vars['min_date_formatted'], DATE_ISO);
|
||||||
|
$ww = variable_get('date_first_day', 1) ? ($ww == 0 ? 6 : $ww - 1) : $ww;
|
||||||
|
$week_date = date('Y-m-d', strtotime("-$ww days", strtotime($vars['min_date_formatted'])));
|
||||||
if (empty($view->date_info->month) || $view->date_info->month == $view->argument['date_argument']->options['wildcard']) {
|
if (empty($view->date_info->month) || $view->date_info->month == $view->argument['date_argument']->options['wildcard']) {
|
||||||
$view->date_info->month = date_format($current_date, 'm');
|
$view->date_info->month = date_format($current_date, 'm');
|
||||||
}
|
}
|
||||||
|
@ -43,7 +46,8 @@ function template_preprocess_calendar_main(&$vars) {
|
||||||
$view->date_info->day = date_format($current_date, 'd');
|
$view->date_info->day = date_format($current_date, 'd');
|
||||||
}
|
}
|
||||||
if (empty($view->date_info->week) || $view->date_info->week == $view->argument['date_argument']->options['wildcard']) {
|
if (empty($view->date_info->week) || $view->date_info->week == $view->argument['date_argument']->options['wildcard']) {
|
||||||
$view->date_info->week = date_week($view->date_info->year .'-'. date_pad($view->date_info->month) .'-'. date_pad($view->date_info->day));
|
$view->date_info->week = date_week(date_pad(date_part_extract($week_date, 'year'), 4) .'-'. date_part_extract($week_date, 'month') .'-'. date_part_extract($week_date, 'day'));
|
||||||
|
# $view->date_info->week = date_week($view->date_info->year .'-'. date_pad($view->date_info->month) .'-'. date_pad($view->date_info->day));
|
||||||
}
|
}
|
||||||
|
|
||||||
$calendar_links = array();
|
$calendar_links = array();
|
||||||
|
@ -55,7 +59,10 @@ function template_preprocess_calendar_main(&$vars) {
|
||||||
$calendar_links['calendar calendar-month'] = $base + array('title' => date_t('Month', 'datetime'), 'href' => date_real_url($view, 'month'));
|
$calendar_links['calendar calendar-month'] = $base + array('title' => date_t('Month', 'datetime'), 'href' => date_real_url($view, 'month'));
|
||||||
}
|
}
|
||||||
if (!empty($displays['week'])) {
|
if (!empty($displays['week'])) {
|
||||||
|
$wy = $view->date_info->year;
|
||||||
|
$view->date_info->year = date_pad(date_part_extract($week_date, 'year'), 4);
|
||||||
$calendar_links['calendar calendar-week'] = $base + array('title' => date_t('Week', 'datetime'), 'href' => date_real_url($view, 'week'));
|
$calendar_links['calendar calendar-week'] = $base + array('title' => date_t('Week', 'datetime'), 'href' => date_real_url($view, 'week'));
|
||||||
|
$view->date_info->year = $wy;
|
||||||
}
|
}
|
||||||
if (!empty($displays['day'])) {
|
if (!empty($displays['day'])) {
|
||||||
$calendar_links['calendar calendar-day'] = $base + array('title' => date_t('Day', 'datetime'), 'href' => date_real_url($view, 'day'));
|
$calendar_links['calendar calendar-day'] = $base + array('title' => date_t('Day', 'datetime'), 'href' => date_real_url($view, 'day'));
|
||||||
|
@ -447,8 +454,10 @@ function template_preprocess_calendar_week(&$vars) {
|
||||||
|
|
||||||
// If we're not grouping by time, move all items into the 'all day' array.
|
// If we're not grouping by time, move all items into the 'all day' array.
|
||||||
if (empty($view->date_info->style_groupby_times)) {
|
if (empty($view->date_info->style_groupby_times)) {
|
||||||
foreach ($row['data']['items'] as $item) {
|
foreach ($row['data']['items'] as $items) {
|
||||||
$row['data']['all_day'] = array_merge($row['data']['all_date'], $item);
|
foreach($items as $item) {
|
||||||
|
$rows['all_day'][] = $item;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$row['data']['items'] = array();
|
$row['data']['items'] = array();
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue