/**
 * Formats a date string into 'YYYY-MM-DD' format.
 *
 * @param dateString - The date string to format. This should be in a format that the JavaScript Date constructor can parse.
 * @returns The formatted date string.
 */
export function formatIsoToDate(dateString: string): string {
  const date = new Date(dateString);
  const year = date.getFullYear(); // get full year
  const month = ('0' + (date.getMonth() + 1)).slice(-2); // Months are 0 based, so we add 1
  const day = ('0' + date.getDate()).slice(-2);
  return `${year}-${month}-${day}`;
}
