| Server IP : 62.60.133.156 / Your IP : 216.73.217.51 Web Server : LiteSpeed System : Linux linux24.centraldnserver.com 4.18.0-553.141.2.lve.el8.x86_64 #1 SMP Wed Jul 8 16:10:02 UTC 2026 x86_64 User : mimradmin ( 1166) PHP Version : 7.4.33 Disable Function : show_source, system, shell_exec, passthru, exec, popen, proc_open MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/mimradmin/theme/digitaz/assets/js/frontend/ |
Upload File : |
(function ($) {
'use strict';
var Countdown = function ($countdown, endTime, $) {
var timeInterval,
elements = {
$daysSpan: $countdown.find('.countdown-days'),
$hoursSpan: $countdown.find('.countdown-hours'),
$minutesSpan: $countdown.find('.countdown-minutes'),
$secondsSpan: $countdown.find('.countdown-seconds')
};
var updateClock = function () {
var timeRemaining = Countdown.getTimeRemaining(endTime);
$.each(timeRemaining.parts, function (timePart) {
var $element = elements['$' + timePart + 'Span'],
partValue = this.toString();
if (1 === partValue.length) {
partValue = 0 + partValue;
}
if ($element.length) {
$element.text(partValue);
}
});
if (timeRemaining.total <= 0) {
clearInterval(timeInterval);
}
};
var initializeClock = function () {
updateClock();
timeInterval = setInterval(updateClock, 1000);
};
initializeClock();
};
Countdown.getTimeRemaining = function (endTime) {
var timeRemaining = endTime - new Date(),
seconds = Math.floor((timeRemaining / 1000) % 60),
minutes = Math.floor((timeRemaining / 1000 / 60) % 60),
hours = Math.floor((timeRemaining / (1000 * 60 * 60)) % 24),
days = Math.floor(timeRemaining / (1000 * 60 * 60 * 24));
if (days < 0 || hours < 0 || minutes < 0) {
seconds = minutes = hours = days = 0;
}
return {
total: timeRemaining,
parts: {
days: days,
hours: hours,
minutes: minutes,
seconds: seconds
}
};
};
var $element = $('[data-countdown="true"]');
$element.each(function (index, el) {
var date = new Date($(this).data('date') * 1000);
new Countdown($(this), date, $);
});
})(jQuery);