Quiero saber cómo puedo obtener diferencias usando dayjs desde la fecha hasta el tipo de matriz actual.
y quiero hacer que la configuración regional también funcione.
// if i input 2021-03 // output will be [2021-04, 2021-05, ... 2022-05] const createdAt = "2021-03"; const selectableMonths = Array(12) .fill(0) .map((_, index) => { const dateText = dayjs().subtract(index, 'months'); return { text: i18next.t("date_format",{ val: new Date(dateText.format("YYYY-MM")), fotmatParams: { en: { short: { year: 'numeric', month: 'short', }, long: { year: 'numeric', month: 'short', day: 'numeric', }, }, ko: { short: { year: 'numeric', month: 'long', }, long: { year: 'numeric', month: 'long', day: 'numeric', }, }, }, } ), value: { from: dateText.format('YYYY-MM'), to: dateText.add(1,'months').format('YYYY-MM'), } } }) .filter((v) => dayjs(v.value.from).isSameOrAfter(dayjs(teamCreatedAt)));este es mi codigo..
¿Cómo puedo obtener una matriz como [2021-04, 2021-05, ... 2022-05]