62,074
社区成员
发帖
与我相关
我的任务
分享
@{
ViewBag.Title = "Test";
}
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script src="../../script/jquery-easyui-1.4.3/jquery.min.js" type="text/javascript"></script>
<script src="../../script/jquery-easyui-1.4.3/jquery.easyui.min.js" type="text/javascript"></script>
<link href="../../script/jquery-easyui-1.4.3/themes/default/easyui.css" rel="stylesheet" type="text/css" />
<link href="../../script/jquery-easyui-1.4.3/themes/icon.css" rel="stylesheet" type="text/css" />
<link href="../../script/jquery-easyui-1.4.3/demo/demo.css" rel="stylesheet" type="text/css" />
</head>
<body>
<h2>Custom Calendar</h2>
<div style="margin:20px 0"></div>
<div class="easyui-calendar" style="width:250px;height:250px;" data-options="formatter:formatDay"></div>
<script>
var d1 = Math.floor((Math.random() * 30) + 1);
var d2 = Math.floor((Math.random() * 30) + 1);
function formatDay(date) {
var m = date.getMonth() + 1;
var d = date.getDate();
var opts = $(this).calendar('options');
if (opts.month == m && d == d1) {
return '<div class="icon-ok md">' + d + '</div>';
} else if (opts.month == m && d == d2) {
return '<div class="icon-search md">' + d + '</div>';
}
return d;
}
</script>
<style scoped="scoped">
.md {
height: 16px;
line-height: 16px;
background-position: 2px center;
text-align: right;
font-weight: bold;
padding: 0 2px;
color: red;
}
</style>
</body>
</html>