Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I override defaults in jQuery Fullcalendar

I use Fullcalendar on my site, but I need all text in different language. There is piece of code in that plugin:

 // function for adding/overriding defaults

 var setDefaults = fc.setDefaults = function(d) {
    $.extend(true, defaults, d);
 };

But I have no ideas how I can use it. Please, I need help.

like image 795
vtambourine Avatar asked Jun 08 '10 09:06

vtambourine


People also ask

How do I start and end date in FullCalendar?

We can get start date by getView event with intervalStart. We can get end date by getView event with intervalEnd. var month = $('#calendar'). fullCalendar('getView').

How do I uninstall FullCalendar 12a?

To delete "12a", add displayEventTime: false . This is the correct answer.

What is FullCalendar io?

FullCalendar generates real React virtual DOM nodes so you can leverage Fiber, React's highly optimized rendering engine. Learn more. Vue. Angular. JavaScript.


1 Answers

You just override the settings when creating the fullcalendar. Like this:

 var options = {
   theme: true,
   header: {
    left: 'prev,next today',
    center: 'title',
    right: 'month,agendaWeek,agendaDay'
   },
   timeFormat: {
    agenda: 'h(:mm)t{ - h(:mm)t}',
    '': 'h(:mm)t{-h(:mm)t }'
   },
   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'],
   dayNames: [ 'Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'],
   dayNamesShort: ['Dom','Lun','Mar','Mié','Jue','Vie','Sáb'],
   buttonText: {
    today: 'hoy',
    month: 'mes',
    week: 'semana',
    day: 'día'
   }
  };

    $('#calendar').fullCalendar(options);
like image 79
Tauren Avatar answered Sep 20 '22 13:09

Tauren