luxon-hijri
Version:
A Hijri date converter based on the Umm al-Qura calendar system, using Luxon for date manipulations.
15 lines (14 loc) • 510 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isValidHijriDate = void 0;
// utils.ts
const hDates_1 = require("./hDates");
function isValidHijriDate(hy, hm, hd) {
const yearRecord = hDates_1.hDatesTable.find(record => record.hy === hy);
if (!yearRecord) {
return false;
}
const daysInMonth = (yearRecord.dpm >> (hm - 1)) & 1 ? 30 : 29;
return hm >= 1 && hm <= 12 && hd >= 1 && hd <= daysInMonth;
}
exports.isValidHijriDate = isValidHijriDate;