mardi 1 août 2017

Laravel with fullcalendar with locale

I have a problem with locale in full Calendar in Laravel. I use "maddhatter/laravel-fullcalendar": "~1.0" and i can't pass locale in FR. If you have any idea, i take it. Thanks

My Controller

class EventController extends Controller
{
    public function index() {
        $events = [];

        $events[] = \Calendar::event(
            'Event One', //event title
            false, //full day event?
            '2017-07-31T1000', //start time (you can also use Carbon instead of DateTime)
            '2017-07-31T1200', //end time (you can also use Carbon instead of DateTime)
            0 //optionally, you can specify an event ID
        );

        $calendar = \Calendar::addEvents($events)
                  ->setOptions([ //set fullcalendar options
            'header' => array('left' => 'prev,next today', 'center' => 'title', 'right' => ''),

            'locale' => 'fr',
            'editable'=> true,
            'navLinks'=> true,
            'selectable'  => true,
            'defaultView' => 'month'
    ])->setCallbacks([ //set fullcalendar callback options (will not be JSON encoded)
        'viewRender' => 'function() {alert("Callbacks!");}'
    ]);  //add an array with addEvents



        return view('agenda', array('calendar' => $calendar));
    }



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire