andrew
andrew

Reputation: 83

Monday as first day , full calendar

Full calendar haves an option called firstDay where you can chose the first day , I want to chose Monday and I set firstDay:1 but it doesn't work on timelineMonth of fullcalendar-scheduler, it only works on basicAgenda,basicMonth.... etc, but in timeline it doesn't , why is this so?

Upvotes: 0

Views: 2700

Answers (1)

Ally Murray
Ally Murray

Reputation: 609

I agree with ADyson that in the month view you would expect it to start on the first day of the month rather than a Monday.

If however you want to display Monday as the first day then you might be able to use a custom view.

$("#calendar").fullCalendar({
  defaultDate: moment().startOf("month").startOf("isoweek"), // Show closest monday
  defaultView: "timelineFourWeeks",
  views: {
    timelineFourWeeks: {
      type: "timeline",
      duration: moment.duration(28, "d"),
      buttonText: "fourWeeks"
    }
  }
});

This will create a custom timeline view with a duration of 28 days, it then finds the closet Monday to the start of the month. So loading it up today (December 29th) it will set the first Monday as November 27th.

Upvotes: 1

Related Questions