特定の年月日を選択する

書式

calendarObj.select(date)

calendarObj : カレンダーオブジェクト
date : 日付または日付が格納された配列

説明

 特定の年月日を選択するにはselect()を使います。パラメータには日付または日付が格納された配列を指定します。

サンプルコード [実行]

<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>Sample</title>
<link rel="stylesheet" href="main.css" type="text/css" media="all">
<link rel="stylesheet" href="css/calendar.css" type="text/css" media="all">
<script type="text/javascript" src="yahoo.js"></script>
<script type="text/javascript" src="dom.js"></script>
<script type="text/javascript" src="event.js"></script>
<script type="text/javascript" src="calendar.js"></script>
<script type="text/javascript"><!--
window.onload = function(){
var myCalendar = new YAHOO.widget.Calendar("cal", "myCalendar");
myCalendar.setYear(2007);
myCalendar.setMonth(1);
myCalendar.select([new Date(2007,1,4),new Date(2007,1,6)]);
myCalendar.render();
}
// --></script>
</head>
<body>
<h1>特定の年月日を選択する</h1>
<div id="myCalendar"></div>
</body>
</html>