en.javascript.info/02-ui/05-widgets/06-widget-tasks/07-calendar/solution/index.html
Ilya Kantor f301cb744d init
2014-10-26 22:10:13 +03:00

31 lines
688 B
HTML
Executable file

<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<link type="text/css" rel="stylesheet" href="calendar.css">
<script src="http://code.jquery.com/jquery.min.js"></script>
<script src="calendar.js"></script>
</head>
<body>
<button onclick="calendar.setValue(new Date())">setValue(сегодня)</button>
<div id="calendar-holder"></div>
<div id="value">тут будет выбранное значение (дата)</div>
<script>
var calendar = new Calendar({
value: {year: 2012, month: 2 }
});
$('#calendar-holder').append(calendar.getElement());
$(calendar).on("select", function(e) {
$('#value').html(e.value+'');
});
</script>
</body>
</html>