'use strict';

var getBroadcastWeeksInMonth = require('./getBroadcastWeeksInMonth.cjs');
var startOfBroadcastWeek = require('./startOfBroadcastWeek.cjs');

/**
 * Return the end date of the week in the broadcast calendar.
 *
 * @since 9.4.0
 */
function endOfBroadcastWeek(date, dateLib) {
    const startDate = startOfBroadcastWeek.startOfBroadcastWeek(date, dateLib);
    const numberOfWeeks = getBroadcastWeeksInMonth.getBroadcastWeeksInMonth(date, dateLib);
    const endDate = dateLib.addDays(startDate, numberOfWeeks * 7 - 1);
    return endDate;
}

exports.endOfBroadcastWeek = endOfBroadcastWeek;
//# sourceMappingURL=endOfBroadcastWeek.cjs.map
