mrt19,
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>datetimepicker demo</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-datetimepicker/2.5.4/jquery.datetimepicker.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-datetimepicker/2.5.4/build/jquery.datetimepicker.full.js"></script>
<script>
$(window).load(function() {
var text = "";
jQuery.datetimepicker.setLocale('ru');
$("#datetimepicker").datetimepicker({
timepicker: false,
format: "d.m.Y",
dayOfWeekStart: 1,
maxDate: 0,
onClose: function(c, f) {
c = (new Date(c)).setHours(0, 0, 0);
var a = new Date;
a.setHours(0, 0, 0);
var d = a.getDate(),
e = a.getMonth() + 1,
g = a.getFullYear(),
d = d + "." + e + "." + g,
k = Math.round((a - c) / 864E5),
e = function(a) {
return function(b) {
return a[1 == b % 10 && 11 != b % 100 ? 0 : 2 <= b % 10 && 4 >= b % 10 && (10 > b % 100 || 20 <= b % 100) ? 1 : 2]
}
},
k = (0 == k ? "Сегодня " : 0 < a ? "Прошло " : (k *= -1,
"Осталось ")) + k + " " + e(["день", "дня", "дней"])(k);
text = "Дата рождения: " + f.val() + "<br>Сегодня: " + d + "<br>" + k + "<br>";
for (var i = 0;; i += 1000) {
k = Math.round((c - a) / 864E5);
if (k > 0) {
text += "ближайший юбилей " + i + " дней через " + k + " " + e(["день", "дня", "дней"])(k) + " " + (new Date(c)).toLocaleDateString() + "<br>";
break
}
c += 24 * 60 * 60 * 1000 * 1000;
}
i += 1000;
c += 24 * 60 * 60 * 1000 * 1000;
k = Math.round((c - a) / 864E5);
text += "следующий юбилей " + i + " дней через " + k + " " + e(["день", "дня", "дней"])(k) + " " + (new Date(c)).toLocaleDateString();
}
})
$('#enter').click(function() {
$(".info").html(text)
})
});
</script>
</head>
<body>
<label for="datetimepicker">Введите дату рождения</label><br>
<input id="datetimepicker" type="text" id="date" /><br>
<input type="button" id="enter" value="Посчитать" /><br>
<span class='info'></span>
</body>
</html>