import { utils } from '../utils'

type Month = {
  name: string
  number: number
}

const MONTHS: Month[] = [
  { number: 1, name: 'Enero' },
  { number: 2, name: 'Febrero' },
  { number: 3, name: 'Marzo' },
  { number: 4, name: 'Abril' },
  { number: 5, name: 'Mayo' },
  { number: 6, name: 'Junio' },
  { number: 7, name: 'Julio' },
  { number: 8, name: 'Agosto' },
  { number: 9, name: 'Septiembre' },
  { number: 10, name: 'Octubre' },
  { number: 11, name: 'Noviembre' },
  { number: 12, name: 'Diciembre' }
]

export class AnniveraryDateUtils {
  static getZeroLeadedText(text: any) {
    return `0${text}`.slice(-2)
  }

  static getMonth(index: any, abbreviated: any) {
    if (!abbreviated) return MONTHS.find(m => m.number === Number(index))?.name ?? 'Enero'
    return MONTHS.find(m => m.number === Number(index))?.name.substring(0, 3).toUpperCase() ?? 'ENE'
  }

  static utils(orientation: any, size: any = undefined) {
    return utils(orientation, size)
  }
}
