UEA-Prodem

This commit is contained in:
2026-06-10 12:38:42 -03:00
parent 3f33154e16
commit c41625e542
9352 changed files with 1128292 additions and 14752 deletions
+16
View File
@@ -0,0 +1,16 @@
import { toDate } from "date-fns";
import { toGregorianDate, toHijriDate } from "../utils/conversion.js";
export function eachYearOfInterval(interval) {
const start = toDate(interval.start);
const end = toDate(interval.end);
if (end.getTime() < start.getTime()) {
return [];
}
const startYear = toHijriDate(start).year;
const endYear = toHijriDate(end).year;
const years = [];
for (let year = startYear; year <= endYear; year += 1) {
years.push(toGregorianDate({ year, monthIndex: 0, day: 1 }));
}
return years;
}