mirror of
https://github.com/hanzoai/jube-fork.git
synced 2026-11-02 14:29:36 +00:00
136 lines
4.6 KiB
HTML
Executable File
136 lines
4.6 KiB
HTML
Executable File
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>API</title>
|
|
<meta charset="utf-8">
|
|
<link href="../content/shared/styles/examples-offline.css" rel="stylesheet">
|
|
<link href="../../styles/kendo.common.min.css" rel="stylesheet">
|
|
<link href="../../styles/kendo.rtl.min.css" rel="stylesheet">
|
|
<link href="../../styles/kendo.default.min.css" rel="stylesheet">
|
|
<link href="../../styles/kendo.default.mobile.min.css" rel="stylesheet">
|
|
<script src="../../js/jquery.min.js"></script>
|
|
<script src="../../js/jszip.min.js"></script>
|
|
<script src="../../js/kendo.all.min.js"></script>
|
|
<script src="../content/shared/js/console.js"></script>
|
|
<script>
|
|
|
|
</script>
|
|
|
|
|
|
</head>
|
|
<body>
|
|
|
|
<a class="offline-button" href="../index.html">Back</a>
|
|
|
|
<div id="example">
|
|
<div class="configurator">
|
|
<div class="header">Configurator</div>
|
|
<div class="box-col">
|
|
<h4>Get range</h4>
|
|
<ul class="options">
|
|
<li>
|
|
<button id="get">Get range</button>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="box-col">
|
|
<h4>Set value</h4>
|
|
<ul class="options">
|
|
<li>
|
|
<input id="startValue" />
|
|
<button id="set">Set range</button>
|
|
<br />
|
|
<input id="endValue" />
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="box-col">
|
|
<h4>Navigation</h4>
|
|
<ul class="options">
|
|
<li>
|
|
<select id="direction">
|
|
<option value="up">upper view</option>
|
|
<option value="down">lower view</option>
|
|
<option value="past">past</option>
|
|
<option value="future" selected="selected">future</option>
|
|
</select>
|
|
<button id="navigate">Navigate</button>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<div style="text-align: center;">
|
|
<div class="demo-section k-content wide" style="display: inline-block;">
|
|
<h4>Pick a date</h4>
|
|
<div id="multiViewCalendar"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
$(document).ready(function () {
|
|
var today = new Date();
|
|
var multiViewCalendar = $("#multiViewCalendar").kendoMultiViewCalendar({
|
|
selectable: "range"
|
|
}).data().kendoMultiViewCalendar;
|
|
multiViewCalendar.value(today);
|
|
|
|
var navigate = function () {
|
|
var value = $("#direction").val();
|
|
switch (value) {
|
|
case "up":
|
|
multiViewCalendar.navigateUp();
|
|
break;
|
|
case "down":
|
|
multiViewCalendar.navigateDown(multiViewCalendar.value());
|
|
break;
|
|
case "past":
|
|
multiViewCalendar.navigateToPast();
|
|
break;
|
|
default:
|
|
multiViewCalendar.navigateToFuture();
|
|
break;
|
|
}
|
|
},
|
|
setValue = function () {
|
|
var start = $("#startValue").data("kendoDatePicker").value();
|
|
var end = $("#endValue").data("kendoDatePicker").value();
|
|
if (start && start && +start < +end) {
|
|
multiViewCalendar.selectRange({ start: start, end: end });
|
|
}
|
|
};
|
|
|
|
$("#get").click(function () {
|
|
var multiViewCalendar = $("#multiViewCalendar").data().kendoMultiViewCalendar;
|
|
var range = multiViewCalendar.selectRange();
|
|
if (range.start && range.end) {
|
|
var options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
|
|
alert("Start: " + range.start.toLocaleDateString("en-US", options) + "\nEnd: " + range.end.toLocaleDateString("en-US", options));
|
|
} else {
|
|
alert("Please select a range");
|
|
}
|
|
});
|
|
|
|
$("#startValue").kendoDatePicker({
|
|
value: today
|
|
});
|
|
|
|
$("#endValue").kendoDatePicker({
|
|
value: new Date(today.getFullYear(), today.getMonth(), today.getDate() + 10)
|
|
});
|
|
|
|
$("#set").click(setValue);
|
|
|
|
$("#direction").kendoDropDownList({
|
|
change: navigate
|
|
});
|
|
|
|
$("#navigate").click(navigate);
|
|
});
|
|
</script>
|
|
</div>
|
|
|
|
|
|
</body>
|
|
</html>
|