Solved a problem access to first day of the year
This commit is contained in:
parent
2f77223658
commit
c9c9965367
1 changed files with 3 additions and 0 deletions
|
@ -19,6 +19,9 @@ function calendar_views_query_alter(&$view, &$query) {
|
||||||
$arg = date_pad(date_part_extract($date, 'year'), 4) .'-'. date_pad(date_part_extract($date, 'month'));
|
$arg = date_pad(date_part_extract($date, 'year'), 4) .'-'. date_pad(date_part_extract($date, 'month'));
|
||||||
break;
|
break;
|
||||||
case 'week':
|
case 'week':
|
||||||
|
$ww = date_day_of_week($date, DATE_ISO);
|
||||||
|
$ww = variable_get('date_first_day', 1) ? ($ww == 0 ? 6 : $ww - 1) : $ww;
|
||||||
|
$date = date('Y-m-d', strtotime("-$ww days", strtotime($date)));
|
||||||
$arg = date_pad(date_part_extract($date, 'year'), 4) .'-W'. date_pad(date_week($date));
|
$arg = date_pad(date_part_extract($date, 'year'), 4) .'-W'. date_pad(date_week($date));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
Reference in a new issue