Hi,

From a fresh calendar view, I have a very strange behavior : all events positioned on Sunday do not appear in the Week display.

  • Month display : Right (see 'Calendar month - settings' and 'Calendar month - preview')
  • Week display : Wrong (see 'Calendar week - settings' and 'Calendar week - preview')

Note : Monday is the first day of the week.

Thanks for help !

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

brulain created an issue. See original summary.

brulain’s picture

[UPDATE]
If I change the first day o the week from Monday to Sunday, the events planned on Sunday appear, but not those planned on Saturday. It looks like Calendar/Week cannot display events scheduled on the last day of the week. In other words, a week would contain only 6 days.

remyarose’s picture

In week calender view query is displaying from start date 00:00:00 to end date 00:00:00.
It need to take start date 00:00:00 to end date 23:59:59.That is the reason it skipping last day in the week

brulain’s picture

Thanks for your answer!
So, what do I have to do?
Best

remyarose’s picture

You can alter that calendar week view query with hook_views_query_alter() through a custom module

function calendar_alter_views_query_alter(&$view, &$query) {
if ($view->name == 'calendar' && $view->current_display == 'page_2') {
$query->where['date']['conditions'][0]['field']="DATE_FORMAT(field_data_field_date.field_date_value, '%Y-%m-%d') >= :node_date_argument AND DATE_FORMAT(field_data_field_date.field_date_value, '%Y-%m-%d') <= :node_date_argument1";
}
}

Reference : http://tylerfrankenstein.com/code/drupal-7-how-modify-views-query-custom...

brulain’s picture

Thanks a lot remyarose, it works great now !

thtas’s picture

I'm having the same problem except the events aren't showing on any Saturdays in week view.

Is this something to do with localised php settings around first day of week? or is it simply that the query is not including the entire day of the final day.

bneil’s picture

Status: Active » Closed (duplicate)

I'm setting this is a duplicate of #1779142: No items are shown in 7th day in the week view for now, although I think it may ultimately be fixed in the work being done in #1137062: date_week_range and date_iso_week_range both returns 1 day too much..