PageSourceSearch

https://www.vogido.nl/wp-content/themes/core-redesignsportlinkclub…/stable/scripts/club-stats-countdown.js

js vogido.nl collected 2026-10-09 22:42:14 UTC 2,598 bytes, 75 lines download raw bytes

1'use strict';
2
3var next = function next(elem) {
4  return document.querySelector(elem);
5};
6
7var countdown = function countdown(_config) {
8  var tarDate = next(_config.target).getAttribute('data-date').split('-');
9  var day = parseInt(tarDate[0]);
10  var month = parseInt(tarDate[1]);
11  var year = parseInt(tarDate[2]);
12  var tarTime = next(_config.target).getAttribute('data-time');
13  var tarhour = void 0,
14    tarmin = void 0;
15
16  if (tarTime != null) {
17    tarTime = tarTime.split(':');
18    tarhour = parseInt(tarTime[0]);
19    tarmin = parseInt(tarTime[1]);
20  }
21
22  var months = [31, new Date().getFullYear() % 4 == 0 ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
23  var dateNow = new Date();
24  var dayNow = dateNow.getDate();
25  var monthNow = dateNow.getMonth() + 1;
26  var yearNow = dateNow.getFullYear();
27  var hourNow = dateNow.getHours();
28  var minNow = dateNow.getMinutes();
29  var count_day = 0,
30    count_hour = 0,
31    count_min = 0;
32  var count_day_isSet = false;
33  var isOver = false;
34
35  // Set the date we're counting down to
36  var countDownDate = new Date(year, month - 1, day, tarhour, tarmin, 0, 0).getTime();
37
38  next(_config.target + ' .day .word').innerHTML = _config.dayWord;
39  next(_config.target + ' .hour .word').innerHTML = _config.hourWord;
40  next(_config.target + ' .min .word').innerHTML = _config.minWord;
41  next(_config.target + ' .sec .word').innerHTML = _config.secWord;
42
43
44  var intvl = setInterval(function () {
45    // Get todays date and time
46    var now = new Date().getTime();
47
48    // Find the distance between now an the count down date
49    var distance = countDownDate - now;
50
51    // Time calculations for days, hours, minutes and seconds
52    var days = Math.floor(distance / (1000 * 60 * 60 * 24));
53    var hours = Math.floor(distance % (1000 * 60 * 60 * 24) / (1000 * 60 * 60));
54    var minutes = Math.floor(distance % (1000 * 60 * 60) / (1000 * 60));
55    var seconds = Math.floor(distance % (1000 * 60) / 1000);
56
57
58    next(_config.target + ' .day .num').innerHTML = addZero(days);
59    next(_config.target + ' .hour .num').innerHTML = addZero(hours);
60    next(_config.target + ' .min .num').innerHTML = addZero(minutes);
61    next(_config.target + ' .sec .num').innerHTML = addZero(seconds);
62
63    // If the count down is over, write some text
64    if (distance < 0) {
65      clearInterval(intvl);
66      next(_config.target).innerHTML = "<div class='club-stats-countdown__item club-stats-countdown__item--expired expired'><span>"+ _config.expired +"</span></div>";
67    }
68  }, 1);
69};
70
71
72
73var addZero = function addZero(x) {
74  return x < 10 && x >= 0 ? "0" + x : x;
75};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.