作成日: 2016/07/01 最終更新日: 2017/12/08
文書種別
使用方法
詳細
C1Calendarで特定の日付のスタイルをカスタマイズするには、クライアント側コールバック関数を実装し、それをC1Calendarの「OnClientCustomizeDate」プロパティに設定する必要がございます。
◎サンプルコード(aspx)
◎サンプルコード(aspx)
<script type="text/javascript">
function customizeDate($daycell, date, dayType, hover, preview) {
if (date.getMonth() === 10 && date.getDate() === 3) //11月3日の場合
{
$daycell.find('a').css('color', 'magenta');
return true;
}
else if (date.getDay() === 0) //日曜日の場合
{
$daycell.find('a').css('color', 'red');
return true;
}
else if (date.getDay() === 6) //土曜日の場合
{
$daycell.find('a').css('color', 'blue');
return true;
}
return false;
}
</script>
・・・
<wijmo:C1Calendar ID="C1Calendar1" runat="server" OnClientCustomizeDate="customizeDate" Culture="ja-JP">
</wijmo:C1Calendar>
function customizeDate($daycell, date, dayType, hover, preview) {
if (date.getMonth() === 10 && date.getDate() === 3) //11月3日の場合
{
$daycell.find('a').css('color', 'magenta');
return true;
}
else if (date.getDay() === 0) //日曜日の場合
{
$daycell.find('a').css('color', 'red');
return true;
}
else if (date.getDay() === 6) //土曜日の場合
{
$daycell.find('a').css('color', 'blue');
return true;
}
return false;
}
</script>
・・・
<wijmo:C1Calendar ID="C1Calendar1" runat="server" OnClientCustomizeDate="customizeDate" Culture="ja-JP">
</wijmo:C1Calendar>
関連情報
旧文書番号
81714