I need to convert the timestamp to the week of the year, and use it with the time selector of antd. I only found the following method, which is the method to get the week of the month. Does anyone know how to get the week of the year?
function weekOfMonth (m: any) {
return Math.ceil(m.date() / 7);
}
function getYearWeek (weekData: any) {
const startDate = moment(weekData).startOf('week');
let weekMonth = weekOfMonth(startDate);
let date = startDate.format('YYYY年MM月');
return `${date}第${weekMonth}周`;
}