如何在laravel中更改日历的语言?

时间:2019-01-22 09:50:24

标签: javascript php laravel fullcalendar

如何将日历的语言更改为阿拉伯语或其他语言 在控制器中。这是我的控制器。

 class CalendarController extends Controller
  {
   public function index()
        {   $link=['/admin/news','/admin/newscreate'];
            $events = [];
            $data = Event::orderBy('created_at','desc')->limit(2)->get();
            if($data->count()) {
                foreach ($data as $key => $value) {
                    $events[] = Calendar::event(
                        $value->title,
                        true,
                        new \DateTime($value->start_date),
                        new \DateTime($value->end_date.' +1 day'),
                        null,
                        // Add color and link on event
                     [ 
                         'color' => '#ff0000',
                         'url' => $link[$key],
                     ]
                    );
                }
            }
            $calendar = Calendar::addEvents($events);
      return view(.....);
  }

1 个答案:

答案 0 :(得分:0)

您可以在脚本中使用此标题来更改月份标题

$('#calendar').fullCalendar({
    monthNames: ['Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'],
    monthNamesShort: ['Ene','Feb','Mar','Abr','May','Jun','Jul','Ago','Sep','Oct','Nov','Dic'],
  });