Files
avz-site/node_modules/react-day-picker/dist/esm/hebrew/lib/findMonthIndexByCode.js
T
2026-05-30 19:59:39 -03:00

11 lines
364 B
JavaScript

import { getMonthCode, monthsInHebrewYear } from "../utils/calendarMath.js";
export function findMonthIndexByCode(year, preferredCode) {
const monthsCount = monthsInHebrewYear(year);
for (let index = 0; index < monthsCount; index += 1) {
if (getMonthCode(year, index) === preferredCode) {
return index;
}
}
return -1;
}