user2209090
user2209090

Reputation: 154

Fullcalendar Week Title Format

Is it possible to get fullcalendar to show week titles as a single letter? So instead of the default:

Mon Tue Wed Thu Fri Sat

how can I display:

S M T W T F S

I've tried:

$('#calendar').fullCalendar({
   header: {
   right: '',
   center: 'prev, title, next',
   left: ''
  },
  columnFormat: {
    month: 'd' //also tried 'D' but a number displayed instead
  }
)}

Upvotes: 2

Views: 3878

Answers (4)

Nacho
Nacho

Reputation: 658

You can use slotLabelFormat:

slotLabelFormat: [
    { weekday: 'narrow' },
]

All possible formats are in documentation: https://fullcalendar.io/docs/v4/date-formatting

Upvotes: 0

Adrika Gupta
Adrika Gupta

Reputation: 41

If you are using dayGridMonth, inside the option apply ,

dayHeaderFormat: {
    weekday: 'narrow'
},

Upvotes: 1

Syed Ibrahim
Syed Ibrahim

Reputation: 583

From version 2.2.4,

You have to modify like this.

$('#calendar').fullCalendar({
    ...
    ...
    ...,
    views: {
        week: { // name of view
            columnFormat: 'dd'
        }
    }
});

Upvotes: 1

depperm
depperm

Reputation: 10746

The shortest you can get is two letters

$('#calendar').fullCalendar({
   header: {
   right: '',
   center: 'prev, title, next',
   left: ''
  },
  columnFormat: {
    month: 'dd' //also tried 'D' but a number displayed instead
  }
});

This library uses moment library and all possible formats can be found here

Upvotes: 4

Related Questions