Month view calendar do not display items on the first day of the month but when I change the date to the 2nd day of the month, it displays the item. Sreenshots provided.

CommentFileSizeAuthor
calendar4.png17.47 KBdoppel
calendar3.png4.04 KBdoppel
calendar2.png14.67 KBdoppel
calendar1.png3.94 KBdoppel
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

doppel’s picture

This code works for me. But I'm not sure if this the best solution.

<?php
function your_module_query_alter(&$view, &$query) {
  if ($view->name == "your_view" )
  {
      // change the from date format to YYY-MM-DD
      $view->query->where['date']['conditions'][0]['field'] = "DATE_FORMAT(FROM_UNIXTIME(field_data_your_field.your_field_value), '%Y-%m-%d') >= :node_date_argument AND DATE_FORMAT(FROM_UNIXTIME(field_data_your_field.your_field_value), '%Y-%m') <= :node_date_argument1";
      // take the date that the calendar passes
      $given_date = $view->query->where['date']['conditions'][0]['value'][':node_date_argument'];
      // and subtract one day
      $new_date =(date('Y-m-d',  strToTime($given_date.' this year -1 day')));
      $view->query->where['date']['conditions'][0]['value'][':node_date_argument'] = $new_date;
  }
}

?>
Kasey_MK’s picture

This code didn't work for me, but I figured out another workaround: https://www.drupal.org/node/2200263#comment-10846886

apaderno’s picture

Version: 7.x-3.5 » 7.x-3.x-dev
Neslee Canil Pinto’s picture

Status: Active » Closed (outdated)

Hi, there will be no more future development for 7.x branch. If you see this issue in 8.x, feel free to file an issue. Close this as Outdated.