Last Sync: 2026-01-24 12:45 (Mobile)
This commit is contained in:
10
.trash/2024-07-16(화) 2.md
Normal file
10
.trash/2024-07-16(화) 2.md
Normal file
@@ -0,0 +1,10 @@
|
||||
<%
|
||||
const getWeekNumber = (dateFrom = new Date()) => {
|
||||
const currentDate = dateFrom.getDate();
|
||||
const startOfMonth = new Date(dateFrom.setDate(1));
|
||||
const weekDay = startOfMonth.getDay();
|
||||
return parseInt(((weekDay - 1) + currentDate) / 7) + 1;
|
||||
}
|
||||
getWeekNumber(new Date());
|
||||
getWeekNumber(new Date('2020-01-28'));
|
||||
%>
|
||||
Reference in New Issue
Block a user