logo

FullCalendar

This version is a pre-release. Read the release notes

formatDate

A utility function that formats a date into a string.

FullCalendar.formatDate( date, settings )

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

settings is an object that holds any of the date format config options. It also accepts the following additional properties:

  • locale — the name of a locale like 'es'
  • timeZone — the name of a time zone. Either 'local', 'UTC', or a named time zone
  • timeZoneImpl — for named time zones. See the main timeZoneImpl setting for more info.

Example:

import { formatDate } from 'fullcalendar'

let str = formatDate('2018-09-01', {
  month: 'long',
  year: 'numeric',
  day: 'numeric',
  timeZoneName: 'short',
  timeZone: 'UTC',
  locale: 'es'
})

console.log(str) // "1 de septiembre de 2018 0:00 UTC"