export function formatEducationPeriod({
  startYear,
  endYear,
  isOngoing,
  presentLabel = "Present",
}: {
  startYear: number;
  endYear?: number | null;
  isOngoing: boolean;
  presentLabel?: string;
}) {
  if (isOngoing) {
    return `${startYear} - ${presentLabel}`;
  }

  if (typeof endYear === "number" && endYear > startYear) {
    return `${startYear} - ${endYear}`;
  }

  return `${startYear}`;
}
