So I have this daterangepicker
In which by default the date is 2020/04/15 and besides it is the <select>
element that has choices of "Daily", "Weekly", "Monthly" (Please see picture below).
Is there any way to compute for which day a week starts in april and how many days april have whenever I clicked the weekly or the monthly in the dropdown besides the daterangepicker
.
For example:
April has 30 days and week 1 starts at April 6 while in March it has 31 days and week 1 starts at March 2
I know that every month has 4 weeks in it but the question is how can i get the day that starts the week in every month. Is there any way to calculate it in javascript? Or should i just start with day 1 then just count 7 days?