Using last version available in -dev

This commit is contained in:
Manuel Cillero 2017-07-26 20:03:36 +02:00
parent f697b66461
commit d12eba903d

View file

@ -36,6 +36,9 @@ function template_preprocess_calendar_main(&$vars) {
else {
$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']) {
$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');
}
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();
@ -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'));
}
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'));
$view->date_info->year = $wy;
}
if (!empty($displays['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 (empty($view->date_info->style_groupby_times)) {
foreach ($row['data']['items'] as $item) {
$row['data']['all_day'] = array_merge($row['data']['all_date'], $item);
foreach ($row['data']['items'] as $items) {
foreach($items as $item) {
$rows['all_day'][] = $item;
}
}
$row['data']['items'] = array();
}