Сообщение от Julius123
|
не очень мне подходит
|
чем не подходит то ?
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">#old{
background:#FFCC33;
color:rgba(0,0,0,0.6);
display:inline-block;
padding:5px 8px;
text-shadow:2px 2px 3px #6666FF;
border-radius:3px;
}
</style>
<script>
function passed(e, b, a) {
function g(f, j, k, l) {
return f + (f % 10 == 1 && f % 100 != 11 ? j : f % 10 >= 2 && f % 10 <= 4 && (f % 100 < 10 || f % 100 >= 20) ? k : l)
}
var c = e;
a = "" + b + "/" + e + "/" + a + "";
a = new Date(a);
a.setHours(0, 0, 0, 0);
b = new Date;
b.setHours(0, 0, 0, 0);
var d = a;
if (b.getTime() < a.getTime()) {
a = b;
b = d;
d = a;
c = a.getDate()
}
for (e = -1; b.getTime() >= d.getTime();) {
a = new Date(d);
e++;
var h = (new Date(d.getFullYear(), d.getMonth() + 2, 0)).getDate(),
i = c;
if (h < c) i = h;
d.setMonth(d.getMonth() + 1, i)
}
c = b.getTime() - a.getTime();
c = (c - c % 864E5) / 864E5;
c = c > 0 ? g(c, " \u0434\u0435\u043d\u044c ", " \u0434\u043d\u044f ", " \u0434\u043d\u0435\u0439 ") : "";
a = (e - e % 12) / 12;
a = a > 0 ? g(a, " \u0433\u043e\u0434 ", " \u0433\u043e\u0434\u0430 ", " \u043b\u0435\u0442 ") : "";
b = e % 12;
b = b > 0 ? g(b, " \u043c\u0435\u0441\u044f\u0446 ", " \u043c\u0435\u0441\u044f\u0446\u0430 ", " \u043c\u0435\u0441\u044f\u0446\u0435\u0432 ") : "";
return a + b + c || "0 \u0434\u043d\u0435\u0439"
};
window.onload = function ()
{
document.getElementById('old').innerHTML = 'Ресурс работает уже ' + passed('28','06','2014')
}
</script>
</head>
<body>
<div id='old'></div>
</body>
</html>