/**
* @description This function is used to find the last day of each month
* @param {*} year
* @param {*} month
* @returns lastDay
*/
function getLastWorkingDayOfMonth(year, month) {
let lastDay = new Date(year, month, 0);
while (lastDay.getDay() === 0 || lastDay.getDay() === 6) { // Sunday (0) or Saturday (6)
lastDay.setDate(lastDay.getDate() - 1); // Move to the previous day
}
return lastDay;
}