Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anomaly in week view #159

Open
fidels80 opened this issue Apr 6, 2022 · 0 comments
Open

Anomaly in week view #159

fidels80 opened this issue Apr 6, 2022 · 0 comments

Comments

@fidels80
Copy link

fidels80 commented Apr 6, 2022

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant