import moment from 'moment/moment'

/**
 * Get week number string
 *
 * e.G. "2024W05"
 */
export const weekNumber = (date: moment.Moment) => {
  const year = date.isoWeekYear()
  const weekNr = date.isoWeek()
  const leadingZero = weekNr < 10 ? '0' : ''
  return `${year}W${leadingZero}${weekNr}`
}