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>
関連記事
-
-
formのpasswordとtextをjQueryで切り替える方法
formでtype="password"を指定していると内容を入力した際に「●● ...
-
-
amazon等のECサイトによくにあるアイテムの満足度を星マークで送信・表示する方法
amazon等のECサイトによくにあるアイテムの満足度を星マークかつ5段階で送信 ...
-
-
jQueryにて複数のajax処理のレスポンスをまとめて表示する方法
同時にajax処理を行う際、挙動やコードの書き方に悩まされることが多い。例えばA ...
-
-
AjaxにてHTTPリクエストメソッドをDELETE / PUTで送信する方法
あるAPIにAjaxでリクエストする際、GET / POSTではなくDELETE ...
-
-
jQueryで偶数or奇数行に任意のClassを付与する方法
tableタグの1行目を除く偶数もしくは奇数行のtrタグに任意にClassを指定 ...