(function () {
  var now = new Date();
  var year = String(now.getFullYear());
  var months = [
    "January", "February", "March", "April", "May", "June",
    "July", "August", "September", "October", "November", "December"
  ];
  var day = now.getDate();
  var v = day % 100;
  var ord = (v - 20) % 10 === 1 || v === 1 ? "st"
    : (v - 20) % 10 === 2 || v === 2 ? "nd"
    : (v - 20) % 10 === 3 || v === 3 ? "rd"
    : "th";
  var dateStr = months[now.getMonth()] + " " + day + ord + ", " + year;

  function fill(selector, value) {
    var nodes = document.querySelectorAll(selector);
    for (var i = 0; i < nodes.length; i++) {
      nodes[i].textContent = value;
    }
  }

  fill(".js-year", year);
  fill(".js-date", dateStr);
})();
