JSFiddle - React, Tailwind, and code Playground

by Joe Saad

HTML

<div id="placeholder"></div>

JavaScript

var curr = new Date; // get current date
var first = curr.getDate() - curr.getDay(); // First day is the day of the month - the day of the week
var last = first + 6; // last day is the first day + 6

var firstday = new Date(curr.setDate(first)).toUTCString();
var lastday = new Date(curr.setDate(last)).toUTCString();


console.log(new Date(curr.setDate(last)).getDate())
console.log('tete')