export function getMinAndMaxDate(offset: number = 3, mode: 'week' | 'month' = 'month'): { minDate: Date; maxDate: Date } {
  const today = new Date();

  switch (mode) {
    case 'month':
      const minDateCal = new Date(today.getFullYear(), today.getMonth() - offset, today.getDate());

      const maxDateCal = new Date(today.getFullYear(), today.getMonth() + offset, today.getDate());

      return { minDate: minDateCal, maxDate: maxDateCal };

    case 'week':
      const minDateWeek = new Date(today.getFullYear(), today.getMonth(), today.getDate() - 7 * offset);
      const maxDateWeek = new Date(today.getFullYear(), today.getMonth(), today.getDate() + 7 * offset);

      return { minDate: minDateWeek, maxDate: maxDateWeek };
  }
}
