407
Views
12
Comments
Solved
[FullCalendar 2] FullCalendar2 show or hide week,list views
Question
fullcalendar-2
Web icon
Forge asset by João Grazina

How to show List view and week view in full calendar 2. My calendar just has arrows and today button.

2018-09-27 18-20-33
Swatantra Kumar
Champion
Solution

sai p wrote:

I added this in Advanced config 

and i am getting this error so calendar is not loading

Remove comma where you finished defining buttonText as shown in your 1st pic.

buttonText: {
  today: 'today',
  dayGridMonth: 'month',
  timeGridWeek: 'week',
  timeGridDay: 'day',
  listMonth: 'list month',
  listWeek: 'list week',
  listDay: 'list day'              
}


2018-09-27 18-20-33
Swatantra Kumar
Champion

// List View

var calendar = new FullCalendar.Calendar(calendarEl, { 

plugins: [ 'list' ], 

defaultView: 'listWeek'

 });

2018-09-27 18-20-33
Swatantra Kumar
Champion

// Week View

let calendar = new Calendar(calendarEl, { 

   plugins: [ dayGridPlugin ],  

  defaultView: 'dayGridWeek'

});

2018-09-27 18-20-33
Swatantra Kumar
Champion

Hi Sai, 

I just pasted the javascript snippets above for both the views (list and week). You should instantiate the object with the desired view as an option.

Regards,

Swatantra

2023-07-03 14-28-45
Vinicius Seixas

If i'm not mistaken you can also enable that in the JSON file for the FullCalendar. 

UserImage.jpg
sai p


I am not sure where to write the java script or JSON because I dont see anything in properties of fullcalendar2


2023-07-03 14-28-45
Vinicius Seixas

Its in the ADVANCED CONFIG



UserImage.jpg
sai p

I tried with this JSON, its not showing any extra buttons


UserImage.jpg
Peter Braat

To add the extra buttons use something like below in the advanced config setting 


header: {
  left: 'prev,next today',
  center: 'title',
  right: 'dayGridMonth,timeGridWeek,timeGridDay,listMonth,listWeek,listDay'
},


and to change the button labels:


buttonText: {
  today: 'today',
  dayGridMonth: 'month',
  timeGridWeek: 'week',
  timeGridDay: 'day',
  listMonth: 'list month',
  listWeek: 'list week',
  listDay: 'list day'              
},


This will show something like:

UserImage.jpg
sai p

I added this in Advanced config 

and i am getting this error so calendar is not loading

2018-09-27 18-20-33
Swatantra Kumar
Champion
Solution

sai p wrote:

I added this in Advanced config 

and i am getting this error so calendar is not loading

Remove comma where you finished defining buttonText as shown in your 1st pic.

buttonText: {
  today: 'today',
  dayGridMonth: 'month',
  timeGridWeek: 'week',
  timeGridDay: 'day',
  listMonth: 'list month',
  listWeek: 'list week',
  listDay: 'list day'              
}


UserImage.jpg
Peter Braat

Hi,


I see 2 commas (,,)  in your advanced config and that is causing a runtime error. Please correct it to just 1 comma (,) and try again.

 Regards,

Peter Braat

UserImage.jpg
sai p

Peter Braat wrote:

Hi,


I see 2 commas (,,)  in your advanced config and that is causing a runtime error. Please correct it to just 1 comma (,) and try again.

 Regards,

Peter Braat

That worked thanks every one


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.