2017 © Pedro Peláez
 

yii2-extension yii2-fullcalendar

Yii2 fullcalendar Widgets

image

hscstudio/yii2-fullcalendar

Yii2 fullcalendar Widgets

  • Saturday, February 13, 2016
  • by hscstudio
  • Repository
  • 2 Watchers
  • 4 Stars
  • 87 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

yii2-fullcalendar

Yii 2 Extension for library calendar.io, (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require --prefer-dist hscstudio/yii2-fullcalendar "*"

or add, (*4)

"hscstudio/yii2-fullcalendar": "*"

to the require section of your composer.json file., (*5)

Usage

You may have a table event (id, title (varchar), start (date/datetime), end (date/datetime)), (*6)

In view, (*7)

<?php $eventUrl = \yii\helpers\Url::to(['event-calendar']); ?>
<?= hscstudio\calendar\FullCalendar::widget([
    'options'=>[
        'id'=>'calendar',
        'header'=>[
            'left'=>'prev,next today',
            'center'=>'title',
            'right'=>'month,agendaWeek,agendaDay',
        ],
        'editable'=> true,
        'eventLimit'=>true, // allow "more" link when too many events
        'events' => [
            'url' => $eventUrl,
        ],
    ]
]) ?>

In controller to get events, (*8)

public function actionEventCalendar($start=NULL,$end=NULL,$_=NULL){

    \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;

    $model= \app\models\Event::find()->all();
    if(!empty($start) and !empty($end)){
        $model= \app\models\Event::find()
            ->where(['>=','start',date('Y-m-d 00:00:01',strtotime($start))])
            ->andWhere(['<=','end',date('Y-m-d 23:59:59',strtotime($end))])
            ->all();
    }

    $events = [];
    foreach ($model as $event) {
        $events[]=[
            'title'=>$event->title,
            'start'=>date('Y-m-d 00:00:01',strtotime($event->start)),
            'end'=>date('Y-m-d 23:59:59', strtotime($event->end)),
            //'color'=>'#CC0000',
            //'allDay'=>true,
            //'url'=>'http://anyurl.com'
        ];
    }
    return $events;
}

How to Contribute

This tools is an OpenSource project so your contribution is very welcome., (*9)

In order to get started:, (*10)

  • Install this in your local (read installation section)
  • Clone this repository.
  • Check README.md.
  • Send pull requests.

Aside from contributing via pull requests you may submit issues., (*11)

Our Team

We'd like to thank our contributors for improving this tools. Thank you!, (*12)

Jakarta - Indonesia, (*13)

The Versions

13/02 2016

dev-master

9999999-dev https://github.com/hscstudio/yii2-fullcalendar

Yii2 fullcalendar Widgets

  Sources   Download

MIT License

The Requires

 

framework yii yii2 fullcalendar

13/02 2016

v1.0

1.0.0.0 https://github.com/hscstudio/yii2-fullcalendar

Yii2 fullcalendar Widgets

  Sources   Download

MIT License

The Requires

 

framework yii yii2 fullcalendar

13/02 2016

v0.3

0.3.0.0 https://github.com/hscstudio/yii2-fullcalendar

Yii2 fullcalendar Widgets

  Sources   Download

MIT License

The Requires

 

framework yii yii2 fullcalendar

13/02 2016

v0.2

0.2.0.0 https://github.com/hscstudio/yii2-fullcalendar

Yii2 fullcalendar Widgets

  Sources   Download

MIT License

The Requires

 

framework yii yii2 fullcalendar

12/02 2016

v0.1

0.1.0.0 https://github.com/hscstudio/yii2-fullcalendar

Yii2 fullcalendar Widgets

  Sources   Download

MIT License

The Requires

 

framework yii yii2 fullcalendar