export const getDateMonthDay = function (currentDate
= new Date()){
let computedDate
= new Date(currentDate
);
let year
= computedDate
.getFullYear();
let month
= computedDate
.getMonth()+1;
let date
= computedDate
.getDate();
let day
= computedDate
.getDay();
let MonthTotalDay
= 0;
let num
= 0;
let remainder
= 0;
let firstDay
= new Date(`${year}/${month}/1`).getDay();
let minuDay
= Math
.abs(firstDay
- day
);
let compareTwentyEightDay
= MonthTotalDay
- 28;
num
= Math
.floor(date
/7);
remainder
= date
%7;
if(remainder
> 0 && minuDay
<= remainder
){
num
= num
+ 1
}
}
转载请注明原文地址:https://tech.qufami.com/read-22926.html