philippfrenzel / yii2fullcalendar

JQuery Fullcalendar Yii2 Extension
GNU General Public License v2.0
132 stars 95 forks source link

Anomaly in week view #159

Open fidels80 opened 2 years ago

fidels80 commented 2 years ago

Hi all! i find this anomaly in week view

in my month view is all perfect image

but in week view no image

i put this code in the index.php ` <?= \yii2fullcalendar\yii2fullcalendar::widget(array(

  'options' => ['lang' => 'it',
  '             class' => 'fullcalendar'
                ],
  'clientOptions' => [                    'selectable' => true,
  'selectHelper' => true,
  'droppable' => true,
  'editable' => true,
 // 'drop' => new JsExpression($JSDropEvent),
  'select' => new JsExpression($JSCode),
  'eventClick' => new JsExpression($JSEventClick),
  'defaultDate' => date('Y-m-d')
            ],
            'events'=> Url::to(['/agenda/jsoncalendar']),
            // $events,

) );?>`

and this into controller `
public function actionJsoncalendar($start=NULL,$end=NULL,$_=NULL){ \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;

    $times = Agenda::find()->all();

    $events = array();

    foreach ($times AS $time){
      //Testing
      $Event = new \yii2fullcalendar\models\Event();
      $Event->id = $time->id;
      $Event->title = $time->elemento;
      $Event->start = date('Y-m-d\TH:i:s\Z',strtotime($time->dadata));
      $Event->end = date('Y-m-d\TH:i:s\Z',strtotime($time->adata));
      $Event->overlap=true;
      $Event->startEditable = true;
      $Event->durationEditable = true;
      $el = trim($time->elemento);
switch ($el) {
    case 'ELE1':
        $Event->color = 'green';
        break;
    case 'ELE2':
        $Event->color = 'red';
        break;
    case 'ELE3':
        $Event->color = 'black';
        break;
    case 'ELE4':
        $Event->color = 'purple';
        break;
    case 'ELE5':
        $Event->color = 'brown';
        break;
    case 'ELE6':
        $Event->color = 'blue';
        break;
}
      $events[] = $Event;
    }
\Yii::warning($events);
    return $events;
  }

`

This is the data structure, where dadata is the start data and adata is enddata image and the data image

But i dont think or better i dot kwnow if it guilty...

what can be?

tka a lot!