jQuery

Weeknummer

Toon weeknummer
<!doctype html>
  <html>
  <head>
  <meta charset="utf-8">
  <title>Toon weenummer</title>
  <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
  </head>
  <body>
  <div id="weeknummer"></div>
  <script>
  Date.prototype.getWeek = function() {
  var dF = new Date(this.getFullYear(),0,1);
  var dT = new Date(this.getFullYear(),this.getMonth(),this.getDate());
  var dY = ((dT - dF +1)/86400000);
  return Math.ceil(dY/7)
  };
jQuery(function(){ 
  var dT = new Date();
  var wN = dT.getWeek();
  $("#weeknummer").html(wN);
  });
  </script>
  </body>
  </html>