export const getCurrentWeekUtils = (date: Date |null): number => {
const currentDate = date || new Date();
// 获取传入日期年份得开始事件 比如 01 月 01日 2024: 00:00 的时间对象
const startOfYear = new Date(currentDate.getFullYear(), 0, 1);
// 计算星期一作为一周的开始时,年初的位置 调整为0
const dayOfWeekAtStart = (startOfYear.getDay() + 6) % 7;
const offset = (dayOfWeekAtStart > 0) ? (7 - dayOfWeekAtStart) : 0;
const daysPassed = Math.floor((currentDate.getTime() - (startOfYear.getTime() - offset * 24 * 60 * 60 * 1000)) / (24 * 60 * 60 * 1000));
const weekNumber = Math.ceil((daysPassed + 1) / 7);
return weekNumber;
}