Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FullCalendar how to display day name above day view

Tags:

fullcalendar

I am using the FullCalendar scheduler and wish to have my calendar set to Agenda Day view, with the option of selecting Week or Month. However, my concern is that the actual day of the week does not show in the default view, only the date as follows:

January 15th, 2018

I really want to have something like:

Monday, January 15th

I don't really even need the year.

The days do appear in week and month view no problem, but I cannot find a setting that allows the day to appear for the day view, which will be extremely useful when users are wanting to skip to 'next Friday' for example without having to consult another view to find out the actual date.

Any ideas?

like image 941
Michael Emerson Avatar asked Mar 08 '23 03:03

Michael Emerson


2 Answers

This is controlled by the "titleFormat" option. You can combine this with view-specific options to change the title only for "day" views:

views: {
  day: {
    titleFormat: 'dddd, MMMM Do YYYY'
  }
},

See http://jsfiddle.net/sbxpv25p/105/ for a working demo.

See also

1) https://fullcalendar.io/docs/text/titleFormat/ (title format option)

2) https://fullcalendar.io/docs/views/View-Specific-Options/ (view specific options)

3) https://fullcalendar.io/docs/utilities/date_formatting_string/ and http://momentjs.com/docs/#/displaying/format/ (characters which can be used to format the date)

like image 129
ADyson Avatar answered Apr 25 '23 00:04

ADyson


With Fullcalendar v5 the syntax changed a little. The format is defined by the local. Weekdays are added by an additional attribute and date formatting:

locale: 'en',
views: {
    day: {
        titleFormat: {
            year: 'numeric', month: 'long', day: 'numeric', weekday: 'short'
        },
    },
},

See

  • https://fullcalendar.io/docs/v5/locale
  • https://fullcalendar.io/docs/v5/titleFormat
  • https://fullcalendar.io/docs/v5/date-formatting
like image 33
wittich Avatar answered Apr 25 '23 02:04

wittich