"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getLeapDays = exports.getLeapMonth = void 0;
var rules_1 = require("./rules");
/**
 * 返回农历年闰月是哪个月；若没有闰月 则返回0
 * @param year 农历年份
 * @return Number (0-12)
 * @example
 * leapMonth = getLeapMonth(1987) ; // leapMonth=6
 */
var getLeapMonth = function (year) {
    return rules_1.LUNAR_INFO[year - 1900] & 0xf;
};
exports.getLeapMonth = getLeapMonth;
/**
 * 返回农历年闰月的天数 若该年没有闰月则返回0
 * @param year 农历年份
 * @return Number (0、29、30)
 * @example
 * leapMonthDay = getLeapDays(1987) ; //leapMonthDay=29
 */
var getLeapDays = function (year) {
    if ((0, exports.getLeapMonth)(year)) {
        return rules_1.LUNAR_INFO[year - 1900] & 0x10000 ? 30 : 29;
    }
    return 0;
};
exports.getLeapDays = getLeapDays;
