如何将日历的语言更改为阿拉伯语或其他语言在控制器中。这是我的控制器。
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(.....);
}
您可以在脚本中使用它更改月份标题
$('#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'],
});