import { DateTime } from 'luxon' export const formatDates = ({ dateOne, dateTwo, format, locale, }: { dateOne?: string dateTwo?: string format: string locale?: string }): string => { let formattedDates = '' if (dateOne) { formattedDates = DateTime.fromISO(dateOne).toFormat(format, { locale }) } if (dateTwo) { formattedDates += ` - ${DateTime.fromISO(dateTwo).toFormat(format, { locale })}` } return formattedDates } export const capitalizeFirstLetter = (rawString: unknown): string => { if (typeof rawString !== 'string') return '' return rawString.charAt(0).toUpperCase() + rawString.slice(1) }