Home > Software design >  How to remove "p" and "a" (for "am" and "pm") from fullcalen
How to remove "p" and "a" (for "am" and "pm") from fullcalen

Time:11-22

I am using the full-calender plugin - version 3.9.0 to integrat a calendar on a larvel-project. (https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.9.0/fullcalendar.js)

The monthly-view from my calendar looks like as following:

enter image description here

So far so good, but as you can see there are the abbrevatins "a" and "p" for "am" and "pm". Because I am developing a german project, i want to use the format HH:mm whithout "a" and "p".

My Code looks like:

 firstDay: 1,
            firstHour: 0,
            slotMinutes: 15,
            slotLabelFormat: ['HH:mm'],

            axisFormat: 'HH:mm',

            views: {
                month: {
                    columnFormat: 'ddd' // set format for month here

                },
                week: {
                    columnFormat: 'D.M.', // set format for week here
                    titleFormat: 'D. MMMM YYYY'
                },
                day: {
                    columnFormat: 'd.M.Y', // set format for day here
                    titleFormat: 'D. MMMM YYYY'
                }
            },

            displayEventTime: true,

            events: '/full-calendar',
            selectable:false,
            selectHelper: true,
            droppable: false,

What is wrong?

CodePudding user response:

You can use the property timeFormat:

$('#calendar').fullCalendar({
  events: [
    {
      title:  'My Event',
      start:  '2010-01-01T14:30:00',
      allDay: false
    }
    // other events here...
  ],
  timeFormat: 'H(:mm)' // uppercase H for 24-hour clock
});

ref: https://fullcalendar.io/docs/v3/timeFormat

  • Related