function formatCalendars(caldavCalendars, userId) {
  const calendars = [];
  caldavCalendars.forEach((caldavCalendar) => {
    const newCalendar = {
      external_id: caldavCalendar.url,
      name: caldavCalendar.displayName,
      description: caldavCalendar.description || `Calendar ${caldavCalendar.displayName}`,
      color: caldavCalendar.color || '#3174ad',
      service_id: this.serviceId,
      user_id: userId,
      ctag: caldavCalendar.ctag,
      sync_token: caldavCalendar.syncToken,
      type: caldavCalendar.type,
      sync: caldavCalendar.type === 'CALDAV',
    };

    calendars.push(newCalendar);
  });

  return calendars;
}
@description Format calendar for Gladys compatibility.
@param {Array} caldavCalendars - Dav calendars to format.
@param {object} userId - Gladys user, calendar owner.
@returns {Array} Formatted calendars.
@example
formatCalendars(calendars, userId)