JSFiddle - React, Tailwind, and code Playground

by Plippie Plop

HTML

<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.1.0/moment.min.js"></script>
<input type="hidden" id="week" name="week" value="52">
<input type="hidden" id="year" name="year" value="2020">

<picture>
  <source srcset="/media/cc0-images/surfer-240-200.jpg"
            media="(min-width: 800px)">
  <img src="https://cdn4.buysellads.net/uu/1/78899/1605215825-1602855645-carbon_2x.png" alt="IMAGE">
  
</picture>
<pre id="pre"></pre>

JavaScript

const date = moment().format();
let w= document.querySelector('#week').value;
let y = document.querySelector('#year').value;
let ws = moment(date).startOf('isoWeek').format();

	

var str = w+ "<br>" + y +"<br>" + ws + "<br>";

for (var i=0; i<7; i++) {
    str += moment(ws).add(i, 'days').format('dd DD-MM-YYY') + '<br>';
   
}

str += moment().year(y).isoWeek(w).format('DD-MM-YYYY') +"<br>";
str += moment().format('DD-MM-YYYY') +"<br>";

document.querySelector('#pre').innerHtml = str;