0

I am using https://fullcalendar.io/ API to create a custom view for Weekly events and monthly events. The issue I am facing is that for weekly view, I want the start of the week to be Monday (1) and monthly to remain Sunday (0).

If I were to add firstDay: 1 as seen below, it will apply to both customWeek and customMonth views. I only need it for customWeek.

header: {
  left: '',
  center: '',
  right: 'customWeek, customMonth'
},
firstDay: 1,
droppable: true,....

Complete code.

$('#calendar').fullCalendar({
header: {
  left: '',
  center: '',
  right: 'customWeek, customMonth'
},
droppable: true,
eventStartEditable: true,
eventLimit: true,
eventLimitText: "MORE",
views: {
  customWeek: {
    type: 'basicWeek',
    buttonText: ' ',
    eventLimit: 1,
    columnFormat: 'D dddd'
  },
  customMonth: {
    type: 'month',
    buttonText: ' ',
    eventLimit: 1,
    columnFormat: 'dddd',
    defaults: {
      fixedWeekCount: false
    }
  }
},
defaultView: 'customWeek',
events: data});

Any ideas or suggestion is appreciated.

1 Answers1

0

As far as I can tell, you can't. It's not one of the options you can pass to a view. The only solution would be to implement a completely custom view which overrides the view class, as detailed here: https://fullcalendar.io/docs/views/Custom_Views .

But that's a lot of work, and I'd argue it's not worth it. I suspect this feature is actually by design - starting on a different day on each view sounds like a great way to confuse your users, who will expect and/or assume that the display is consistent.

ADyson
  • 57,178
  • 14
  • 51
  • 63