We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42239
    • 73 Posts
    revo 2.2.12
    mxcalendar 1.1.10

    Adding an event on start: 8/09/2014 - 4:00 PM. end 8/10/2014 12:00 PM.

    Calendar only lists the first day. Looks like the time has to be the same or greater for it to populate on calendar. Anybody know how to change this to anytime? Couldn't figure out a change in the snippet.
      • 1343 ☆ A M B ☆
      • 2,213 Posts
      If I remember correctly there is a known issue with multi-day events. You might check: https://github.com/CharlesMx/mxCalendar
        Patrick | Server Wrangler
        About Me: Website | Tweets |  MODX Hosting
        • 42239
        • 73 Posts
        Quote from: AMDbuilder at Aug 04, 2014, 06:03 PM
        If I remember correctly there is a known issue with multi-day events. You might check: https://github.com/CharlesMx/mxCalendar

        I checked this out and it looks like it was a solved issue in this release with commit #127. Honestly I think everything is working correctly as it is intended, i'm looking to modify how it is intended to work.
          • 42239
          • 73 Posts
          So best I can tell there seems to some kind of issue with what value is given for $mxcArray['durDay'].

           if(version_compare(PHP_VERSION, '5.3.0') >= 0){
                  $diff = $eStart->diff($eEnd);
                  $durYear = $diff->format('%y');
                  $durMonth = $diff->format('%m');
                  $durDay = $diff->format('%d');
                  $durHour = $diff->format('%h');
                  $durMin = $diff->format('%i');
                  $durSec = $diff->format('%s');
              } else {
                  $diff = (object)$mxcal->datediff($mxc->get('startdate'),$mxc->get('enddate'),true);
                  $durYear = $diff->years;
                  $durMonth = $diff->months;
                  $durDay = $diff->days;
                  $durHour = $diff->hours;
                  $durMin = $diff->minutes;
                  $durSec = $diff->seconds;
              }
              
              //-- return event duration values 
              $mxcArray['durYear']    = !empty($durYear) ? $durYear : null; 
              $mxcArray['durMonth']    = !empty($durMonth) ? $durMonth : null; 
              $mxcArray['durDay']      = !empty($durDay) ? $durDay : null; 
              $mxcArray['durHour']     = !empty($durHour) ? $durHour : null; 
              $mxcArray['durMin']      = !empty($durMin) ? $durMin : null; 
              $mxcArray['durSec']      = !empty($durSec) ? $durSec : null;
              $mxcArray['mxcmodalClass'] = ($modalView && $ajaxResourceId || isset($_REQUEST['imajax']) ? 'mxcmodal' : '');
          
              // Add date for each day in a multiple day event ( #127 )
              if($mxcArray['durDay'] !== null && $mxcArray['durDay'] >= 1){
                  if($debug) echo 'Multiple Day Event: '.$mxcArray['title'].'<br />';
                  for($i = 1; $i<=[i][u][b]$mxcArray['durDay'][/b][/u][/i]; $i++){
                      $theSpanDate = strtotime('+'.$i.' day', $mxcArray['startdate']);
                      $arrEventDates[$mxcArray['id'].'_'.$i] = array('date'=>$theSpanDate, 'eventId'=>$mxcArray['id'],'repeatId'=>null);
                      if($debug) echo '   ++(0)  '.strftime($dateFormat.' '.$timeFormat, $theSpanDate).'<br>';
                  }
              }


          Problem with datediff()? Where would I find this function? Is there something there that subtracts 1 if end time is < start time?