jQuery UI Datepickerで日本の祝祭日を表示
2014/07/02
やりたかった事は、jQueryのカレンダーピッカーで
日本の祝祭日の色を変えるというもの。
有名なjQueryUIDatepickerを使用。
■参考サイト
http://0-oo.net/sbox/javascript/google-calendar-holidays
■サンプル
http://sample.taitan916.info/calender2/
■ソース
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8"/>
<title>ピッカーで祝日表示</title>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/themes/ui-lightness/jquery-ui.css">
<link rel="stylesheet" href="./style.css"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1/i18n/jquery.ui.datepicker-ja.min.js"></script>
<script src="./holiday.js"></script>
<script>
$(function(){
$("#calender1,#calender2").datepicker({
changeYear:true,changeMonth:true
});
});
</script>
</head>
<body>
<input type="text" id="calender1"> ~ <input type="text" id="calender2">
</body>
</html>
関連記事
-
-
CodeIgniter4&Bootstrap&jQueryで簡易版お問い合わせページの作成
CodeIgniter4.4.4&Bootstrap&jQuer ...
-
-
セレクトメニューにサジェスト機能をつける方法(select2)
formのselectメニューで何文字が入力すると候補を絞って表示させるサジェス ...
-
-
国土地理院のAPIを使用して無料でジオコーディング(住所→経度緯度)を行う方法
GoogleMapAPIでジオコーディングをするには、支払い情報を登録したアカウ ...
-
-
formでdisplay:none;にしてても送信される
formで特定の部分をdisplay:none;で非表示にしてても 内容は送信さ ...
-
-
jQueryでshow/hideよりaddClass/removeClassの方が速い
diaplay:none/blockする際に最近はshow()/hide()を ...