edit doc

Calendar::formatIso

Formats a date into an ISO8601 string. Outputs a UTC offset appropriate to the calendar it’s called on.

calendar.formatIso( date, [ omitTime = false ] )

date can be a Date Object or something that will parse into a Date Object.

If omitTime is set to true, a string like 2019-09-01 will be produced. Otherwise, the time part will be included.

Example:

import { Calendar } from '@fullcalendar/core';
import dayGridPlugin from '@fullcalendar/daygrid';

document.addEventListener('DOMContentLoaded', function() {
  var calendarEl = document.getElementById('calendar');

  var calendar = new Calendar(calendarEl, {
    plugins: [ dayGridPlugin ],
    timeZone: 'local',
    locale: 'es'
  });

  var str = calendar.formatIso('2018-09-01');

  console.log(str); // "2018-09-01T00:00:00-05:00" when in America/New_York
});

If you simply need to output an ISO8601 string that is normalized to a 00:00 UTC offset, it is more efficient to use the native Date’s toISOString method.