Open fidels80 opened 2 years ago
Hi all! i find this anomaly in week view
in my month view is all perfect
but in week view no
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 and the data
But i dont think or better i dot kwnow if it guilty...
what can be?
tka a lot!
Hi all! i find this anomaly in week view
in my month view is all perfect![image](https://user-images.githubusercontent.com/63100124/161993152-125b740a-0b2e-4cca-9fbd-c2af97b85b64.png)
but in week view no![image](https://user-images.githubusercontent.com/63100124/161993395-8a5a63b6-85bc-482a-a07d-db44aa21da05.png)
i put this code in the index.php ` <?= \yii2fullcalendar\yii2fullcalendar::widget(array(
) );?>`
and this into controller `
public function actionJsoncalendar($start=NULL,$end=NULL,$_=NULL){ \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
`
This is the data structure, where dadata is the start data and adata is enddata
and the data
![image](https://user-images.githubusercontent.com/63100124/161994649-ae488d7a-8892-4b5c-8b9c-c11802bb3503.png)
But i dont think or better i dot kwnow if it guilty...
what can be?
tka a lot!