в общем, поставил, но так и не заработало, -1 пряник каждый день... посоветовали вот такое решение
define("countdown", [],
function () {
var Countdown = {
start: 17,
storage: true,
init: function () {
var interval,
now,
then,
diff,
random,
placeValue;
this.$el = $(".countdown");
this.$descr = $(".countdown-descr");
this.placesTotal = $(".places-total");
this.$place1 = $(".place-1");
this.$place2 = $(".place-2");
this.$place3 = $(".place-3");
try {
localStorage.setItem("item", "text");
localStorage.removeItem("item");
} catch (e) {
Countdown.storage = false;
}
if (localStorage.countdownValue && localStorage.countdownDate) {
this.value = localStorage.countdownValue;
this.$el.html(this.value);
then = new Date(localStorage.countdownDate);
now = new Date();
diff = Math.round(Math.abs((now.getTime() - then.getTime()) / 8.64e7 ));
if (diff > 0 && this.value > 3) {
if (diff + 1 > this.value) {
diff = 1;
}
this.value -= diff;
this.save();
}
localStorage.setItem("countdownDate", new Date());
}
else {
this.value = this.start;
this.save();
}
if (this.value > 17) {
interval = setInterval(function () {
if (Countdown.value > 17) {
Countdown.value--;
localStorage.setItem("countdownDate", new Date());
Countdown.save();
}
else {
clearInterval(interval);
}
}, 200);
}
this.saveDescr();
},
save: function () {
localStorage.setItem("countdownValue", this.value);
this.$el.html(this.value);
if (this.value === this.start) {
this.placesTotal.hide();
}
else {
this.placesTotal.show();
}
},
reducePlaces: function () {
var value1 = this.$place1.html(),
value2 = this.$place2.html(),
value3 = this.$place3.html(),
random,
success = false;
while (success == false) {
random = Math.round(Math.random() * (4 - 1) + 1);
if (random == 1) {
if (value1 < 3) {
continue;
}
else {
this.$place1.html(-3); //--value
success = true;
}
}
else if (random == 3) {
if (value3 < 3) {
continue;
}
else {
this.$place3.html(--value3);
success = true;
}
}
else if (random == 3 || random == 4) {
if (value2 < 3) {
continue;
}
else {
this.$place2.html(--value2);
success = true;
}
}
}
},
saveDescr: function () {
if (this.value < 5) {
this.$descr.html("места");
}
}
}
return Countdown;
})
но эфект все тот же... -1, я уже не знаю к кому обращаться и что писать...