boutique replica bags up ideas

the best replique rolex and prices here.

julia highlight 99j hair color 10a quality straight human hair lace front wigs 8 - 24 inches pre plucked hairline 13x4 inches lace front brazilian wig onlinefor sale

Javascript: Get the first day of the week from current date

Updated on     Kisan Patel

Problem:
How to get the first day of the week from current date?
Get the Monday of the Current week using JavaScript.

Solution:
Using the getDay() method of Date objects, you can know the number of day of the week (being 0=Sunday, 1=Monday, etc).

You can then subtract that number of days plus one, for example:

function getMondayOfCurrentWeek() {
   const today = new Date();
   const first = today.getDate() - today.getDay() + 1;

   const monday = new Date(today.setDate(first));
   return monday;
}

console.log(getMondayOfCurrentWeek());

JavaScript

Leave a Reply