export async function getCurrentDate(date: Date): Promise<string> {
  const currentDate = date;
  const year = currentDate.getFullYear();
  const month = String(currentDate.getMonth() + 1).padStart(2, '0'); // Month is zero-based
  const day = String(currentDate.getDate()).padStart(2, '0');
  const formattedDate = `${year}-${month}-${day}`;
  return formattedDate;
}

export function getFormattedDate(date: Date) {
  const inputDate = new Date(date);
  const day = inputDate.getDate().toString().padStart(2, '0');
  const month = inputDate
    .toLocaleString('default', { month: 'short' })
    .padStart(2, '0');
  const year = inputDate.getFullYear().toString().slice(2);

  const formattedDateWithYear = `${day} ${month} ${year}`;
  const formattedDateWithoutYear = `${day} ${month}`;

  return { formattedDateWithYear, formattedDateWithoutYear };
}
