- 25% Off Jackets I Sweaters I Dresses 0000000 Code: HERBST24
function countdown( dateEnd ) {
var timer, days, hours, minutes, seconds;
dateEnd = new Date( dateEnd );
dateEnd = dateEnd.getTime();
var today = new Date();
Date.prototype.stdTimezoneOffset = function () {
var jan = new Date(this.getFullYear(), 0, 1);
var jul = new Date(this.getFullYear(), 6, 1);
return Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());
}
Date.prototype.isDstObserved = function () {
return this.getTimezoneOffset() < this.stdTimezoneOffset();
}
if ( isNaN( dateEnd ) ) {
return;
}
timer = setInterval( calculate, 1000 );
function calculate() {
var dateStart = new Date();
var dateStart = new Date( dateStart.getUTCFullYear(),
dateStart.getUTCMonth(),
dateStart.getUTCDate(),
dateStart.getUTCHours(),
dateStart.getUTCMinutes(),
dateStart.getUTCSeconds() );
var timeRemaining = parseInt( ( dateEnd - dateStart.getTime() ) / 1000 );
if ( timeRemaining >= 0 ) {
days = parseInt( timeRemaining / 86400 );
timeRemaining = ( timeRemaining % 86400 );
if (today.isDstObserved()) {
hours = parseInt( timeRemaining / 3600 );
} else {
hours = parseInt( (timeRemaining / 3600) - 1 );
}
timeRemaining = ( timeRemaining % 3600 );
minutes = parseInt( timeRemaining / 60 );
timeRemaining = ( timeRemaining % 60 );
seconds = parseInt( timeRemaining );
var daysClass = document.getElementsByClassName( "days66f53a6772b42" );
var hoursClass = document.getElementsByClassName( "hours66f53a6772b42" );
var minutesClass = document.getElementsByClassName( "minutes66f53a6772b42" );
var secondsClass = document.getElementsByClassName( "seconds66f53a6772b42" );
for(var i = 0; i < daysClass.length; i++)
{
daysClass[i].innerHTML = parseInt( days, 10 );
}
for(var i = 0; i < hoursClass.length; i++)
{
hoursClass[i].innerHTML = ( "0" + hours ).slice( -2 );
}
for(var i = 0; i < minutesClass.length; i++)
{
minutesClass[i].innerHTML = ( "0" + minutes ).slice( -2 );
}
for(var i = 0; i < secondsClass.length; i++)
{
secondsClass[i].innerHTML = ( "0" + seconds ).slice( -2 );
}
document.getElementById( "countDown66f53a6772b42" ).classList.remove("spin");
if ( parseInt( days, 10 ) == 1 ) {
for(var i = 0; i < daysClass.length; i++)
{
daysClass[i].classList.add("one");
}
}
if ( parseInt( days, 10 ) == 0 ) {
for(var i = 0; i < daysClass.length; i++)
{
daysClass[i].classList.add("hide");
}
}
} else {
document.getElementById( "countDown66f53a6772b42" ).innerHTML = "Aktion beendet";
}
}
function display( days, hours, minutes, seconds ) {}
}
countdown( '2024-10-07T00:00:00+02:00' );