Skip to content

Instantly share code, notes, and snippets.

@yatt
Last active August 29, 2015 14:17
Show Gist options
  • Select an option

  • Save yatt/fd3cc4f9bd77f907711d to your computer and use it in GitHub Desktop.

Select an option

Save yatt/fd3cc4f9bd77f907711d to your computer and use it in GitHub Desktop.
ANA season chart 2015 domestic
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>ANA Season Clendar</title>
<!-- ref: http://shanabrian.com/web/javascript/date04.php
-->
<!-- CSS -->
<link href="fullcalendar-2.3.1/fullcalendar.min.css" rel="stylesheet" type="text/css">
<style>
<style type="text/css">
.calendar_container td {
text-align: right;
}
.calendar_container td[grade=L] {
text-align: right;
background-color:#BAD4EF;
}
.calendar_container td[grade=R] {
text-align: right;
background-color:#D6E9C3;
}
.calendar_container td[grade=H] {
text-align: right;
background-color:#E4C1DB;
}
.calendar_container tbody th {
font-weight: normal;
font-size: small;
}
.calendar_container td[ban_chaku=true] {
color: blue;
font-weight: bold;
text-decoration: underline;
}
.calendar_container td[ban_hatsu=true] {
color: red;
font-weight: bold;
text-decoration: underline;
}
</style>
<!-- JavaScript -->
<script type="text/javascript" src="calendar.js"></script>
<script type="text/javascript" src="jquery.min.js"></script>
<script>
$(document).ready(function() {
var year = 2015;
$("#y").text(year + "年");
for (var month = 1; month <= 12; month++)
{
var elem = document.getElementById('m' + ('0' + month).substr(-2,2));
var calendar = new Calendar(elem,{
year: year,
month: month,
controllerVisible: false,
titleFormat: 'm月',
});
calendar.view(); // 表示
}
var daygrademap = {
'2015-01-01': 'H'
,'2015-01-02': 'H'
,'2015-01-03': 'H'
,'2015-01-04': 'H'
,'2015-01-05': 'H'
,'2015-01-06': 'L'
,'2015-01-07': 'L'
,'2015-01-08': 'L'
,'2015-01-09': 'L'
,'2015-01-10': 'L'
,'2015-01-11': 'L'
,'2015-01-12': 'L'
,'2015-01-13': 'L'
,'2015-01-14': 'L'
,'2015-01-15': 'L'
,'2015-01-16': 'L'
,'2015-01-17': 'L'
,'2015-01-18': 'L'
,'2015-01-19': 'L'
,'2015-01-20': 'L'
,'2015-01-21': 'L'
,'2015-01-22': 'L'
,'2015-01-23': 'L'
,'2015-01-24': 'L'
,'2015-01-25': 'L'
,'2015-01-26': 'L'
,'2015-01-27': 'L'
,'2015-01-28': 'L'
,'2015-01-29': 'L'
,'2015-01-30': 'L'
,'2015-01-31': 'L'
,'2015-02-01': 'L'
,'2015-02-02': 'L'
,'2015-02-03': 'L'
,'2015-02-04': 'L'
,'2015-02-05': 'L'
,'2015-02-06': 'L'
,'2015-02-07': 'L'
,'2015-02-08': 'L'
,'2015-02-09': 'L'
,'2015-02-10': 'L'
,'2015-02-11': 'L'
,'2015-02-12': 'L'
,'2015-02-13': 'L'
,'2015-02-14': 'L'
,'2015-02-15': 'L'
,'2015-02-16': 'L'
,'2015-02-17': 'L'
,'2015-02-18': 'L'
,'2015-02-19': 'L'
,'2015-02-20': 'L'
,'2015-02-21': 'L'
,'2015-02-22': 'L'
,'2015-02-23': 'L'
,'2015-02-24': 'L'
,'2015-02-25': 'L'
,'2015-02-26': 'L'
,'2015-02-27': 'L'
,'2015-02-28': 'R'
,'2015-03-01': 'R'
,'2015-03-02': 'R'
,'2015-03-03': 'R'
,'2015-03-04': 'R'
,'2015-03-05': 'R'
,'2015-03-06': 'R'
,'2015-03-07': 'R'
,'2015-03-08': 'R'
,'2015-03-09': 'R'
,'2015-03-10': 'R'
,'2015-03-11': 'R'
,'2015-03-12': 'R'
,'2015-03-13': 'R'
,'2015-03-14': 'R'
,'2015-03-15': 'R'
,'2015-03-16': 'R'
,'2015-03-17': 'R'
,'2015-03-18': 'R'
,'2015-03-19': 'R'
,'2015-03-20': 'H'
,'2015-03-21': 'H'
,'2015-03-22': 'H'
,'2015-03-23': 'H'
,'2015-03-24': 'H'
,'2015-03-25': 'H'
,'2015-03-26': 'H'
,'2015-03-27': 'H'
,'2015-03-28': 'H'
,'2015-03-29': 'H'
,'2015-03-30': 'H'
,'2015-03-31': 'H'
,'2015-04-01': 'L'
,'2015-04-02': 'L'
,'2015-04-03': 'L'
,'2015-04-04': 'L'
,'2015-04-05': 'L'
,'2015-04-06': 'L'
,'2015-04-07': 'L'
,'2015-04-08': 'L'
,'2015-04-09': 'L'
,'2015-04-10': 'L'
,'2015-04-11': 'L'
,'2015-04-12': 'L'
,'2015-04-13': 'L'
,'2015-04-14': 'L'
,'2015-04-15': 'L'
,'2015-04-16': 'L'
,'2015-04-17': 'L'
,'2015-04-18': 'L'
,'2015-04-19': 'L'
,'2015-04-20': 'L'
,'2015-04-21': 'L'
,'2015-04-22': 'L'
,'2015-04-23': 'L'
,'2015-04-24': 'H'
,'2015-04-25': 'H'
,'2015-04-26': 'H'
,'2015-04-27': 'H'
,'2015-04-28': 'H'
,'2015-04-29': 'H'
,'2015-04-30': 'H'
,'2015-05-01': 'H'
,'2015-05-02': 'H'
,'2015-05-03': 'H'
,'2015-05-04': 'H'
,'2015-05-05': 'H'
,'2015-05-06': 'H'
,'2015-05-07': 'H'
,'2015-05-08': 'R'
,'2015-05-09': 'R'
,'2015-05-10': 'R'
,'2015-05-11': 'R'
,'2015-05-12': 'R'
,'2015-05-13': 'R'
,'2015-05-14': 'R'
,'2015-05-15': 'R'
,'2015-05-16': 'R'
,'2015-05-17': 'R'
,'2015-05-18': 'R'
,'2015-05-19': 'R'
,'2015-05-20': 'R'
,'2015-05-21': 'R'
,'2015-05-22': 'R'
,'2015-05-23': 'R'
,'2015-05-24': 'R'
,'2015-05-25': 'R'
,'2015-05-26': 'R'
,'2015-05-27': 'R'
,'2015-05-28': 'R'
,'2015-05-29': 'R'
,'2015-05-30': 'R'
,'2015-05-31': 'R'
,'2015-06-01': 'R'
,'2015-06-02': 'R'
,'2015-06-03': 'R'
,'2015-06-04': 'R'
,'2015-06-05': 'R'
,'2015-06-06': 'R'
,'2015-06-07': 'R'
,'2015-06-08': 'R'
,'2015-06-09': 'R'
,'2015-06-10': 'R'
,'2015-06-11': 'R'
,'2015-06-12': 'R'
,'2015-06-13': 'R'
,'2015-06-14': 'R'
,'2015-06-15': 'R'
,'2015-06-16': 'R'
,'2015-06-17': 'R'
,'2015-06-18': 'R'
,'2015-06-19': 'R'
,'2015-06-20': 'R'
,'2015-06-21': 'R'
,'2015-06-22': 'R'
,'2015-06-23': 'R'
,'2015-06-24': 'R'
,'2015-06-25': 'R'
,'2015-06-26': 'R'
,'2015-06-27': 'R'
,'2015-06-28': 'R'
,'2015-06-29': 'R'
,'2015-06-30': 'R'
,'2015-07-01': 'R'
,'2015-07-02': 'R'
,'2015-07-03': 'R'
,'2015-07-04': 'R'
,'2015-07-05': 'R'
,'2015-07-06': 'R'
,'2015-07-07': 'R'
,'2015-07-08': 'R'
,'2015-07-09': 'R'
,'2015-07-10': 'R'
,'2015-07-11': 'R'
,'2015-07-12': 'R'
,'2015-07-13': 'R'
,'2015-07-14': 'R'
,'2015-07-15': 'R'
,'2015-07-16': 'R'
,'2015-07-17': 'R'
,'2015-07-18': 'R'
,'2015-07-19': 'R'
,'2015-07-20': 'R'
,'2015-07-21': 'R'
,'2015-07-22': 'R'
,'2015-07-23': 'R'
,'2015-07-24': 'R'
,'2015-07-25': 'R'
,'2015-07-26': 'R'
,'2015-07-27': 'R'
,'2015-07-28': 'R'
,'2015-07-29': 'R'
,'2015-07-30': 'R'
,'2015-07-31': 'R'
,'2015-08-01': 'R'
,'2015-08-02': 'R'
,'2015-08-03': 'R'
,'2015-08-04': 'R'
,'2015-08-05': 'R'
,'2015-08-06': 'R'
,'2015-08-07': 'H'
,'2015-08-08': 'H'
,'2015-08-09': 'H'
,'2015-08-10': 'H'
,'2015-08-11': 'H'
,'2015-08-12': 'H'
,'2015-08-13': 'H'
,'2015-08-14': 'H'
,'2015-08-15': 'H'
,'2015-08-16': 'H'
,'2015-08-17': 'H'
,'2015-08-18': 'R'
,'2015-08-19': 'R'
,'2015-08-20': 'R'
,'2015-08-21': 'R'
,'2015-08-22': 'R'
,'2015-08-23': 'R'
,'2015-08-24': 'R'
,'2015-08-25': 'R'
,'2015-08-26': 'R'
,'2015-08-27': 'R'
,'2015-08-28': 'R'
,'2015-08-29': 'R'
,'2015-08-30': 'R'
,'2015-08-31': 'R'
,'2015-09-01': 'R'
,'2015-09-02': 'R'
,'2015-09-03': 'R'
,'2015-09-04': 'R'
,'2015-09-05': 'R'
,'2015-09-06': 'R'
,'2015-09-07': 'R'
,'2015-09-08': 'R'
,'2015-09-09': 'R'
,'2015-09-10': 'R'
,'2015-09-11': 'R'
,'2015-09-12': 'R'
,'2015-09-13': 'R'
,'2015-09-14': 'R'
,'2015-09-15': 'R'
,'2015-09-16': 'R'
,'2015-09-17': 'R'
,'2015-09-18': 'R'
,'2015-09-19': 'R'
,'2015-09-20': 'R'
,'2015-09-21': 'R'
,'2015-09-22': 'R'
,'2015-09-23': 'R'
,'2015-09-24': 'R'
,'2015-09-25': 'R'
,'2015-09-26': 'R'
,'2015-09-27': 'R'
,'2015-09-28': 'R'
,'2015-09-29': 'R'
,'2015-09-30': 'R'
,'2015-10-01': 'R'
,'2015-10-02': 'R'
,'2015-10-03': 'R'
,'2015-10-04': 'R'
,'2015-10-05': 'R'
,'2015-10-06': 'R'
,'2015-10-07': 'R'
,'2015-10-08': 'R'
,'2015-10-09': 'R'
,'2015-10-10': 'R'
,'2015-10-11': 'R'
,'2015-10-12': 'R'
,'2015-10-13': 'R'
,'2015-10-14': 'R'
,'2015-10-15': 'R'
,'2015-10-16': 'R'
,'2015-10-17': 'R'
,'2015-10-18': 'R'
,'2015-10-19': 'R'
,'2015-10-20': 'R'
,'2015-10-21': 'R'
,'2015-10-22': 'R'
,'2015-10-23': 'R'
,'2015-10-24': 'R'
,'2015-10-25': 'R'
,'2015-10-26': 'R'
,'2015-10-27': 'R'
,'2015-10-28': 'R'
,'2015-10-29': 'R'
,'2015-10-30': 'R'
,'2015-10-31': 'R'
,'2015-11-01': 'R'
,'2015-11-02': 'R'
,'2015-11-03': 'R'
,'2015-11-04': 'R'
,'2015-11-05': 'R'
,'2015-11-06': 'R'
,'2015-11-07': 'R'
,'2015-11-08': 'R'
,'2015-11-09': 'R'
,'2015-11-10': 'R'
,'2015-11-11': 'R'
,'2015-11-12': 'R'
,'2015-11-13': 'R'
,'2015-11-14': 'R'
,'2015-11-15': 'R'
,'2015-11-16': 'R'
,'2015-11-17': 'R'
,'2015-11-18': 'R'
,'2015-11-19': 'R'
,'2015-11-20': 'R'
,'2015-11-21': 'R'
,'2015-11-22': 'R'
,'2015-11-23': 'R'
,'2015-11-24': 'R'
,'2015-11-25': 'R'
,'2015-11-26': 'R'
,'2015-11-27': 'R'
,'2015-11-28': 'R'
,'2015-11-29': 'R'
,'2015-11-30': 'L'
,'2015-12-01': 'L'
,'2015-12-02': 'L'
,'2015-12-03': 'L'
,'2015-12-04': 'L'
,'2015-12-05': 'L'
,'2015-12-06': 'L'
,'2015-12-07': 'L'
,'2015-12-08': 'L'
,'2015-12-09': 'L'
,'2015-12-10': 'L'
,'2015-12-11': 'L'
,'2015-12-12': 'L'
,'2015-12-13': 'L'
,'2015-12-14': 'L'
,'2015-12-15': 'L'
,'2015-12-16': 'L'
,'2015-12-17': 'L'
,'2015-12-18': 'L'
,'2015-12-19': 'L'
,'2015-12-20': 'L'
,'2015-12-21': 'L'
,'2015-12-22': 'L'
,'2015-12-23': 'H'
,'2015-12-24': 'H'
,'2015-12-25': 'H'
,'2015-12-26': 'H'
,'2015-12-27': 'H'
,'2015-12-28': 'H'
,'2015-12-29': 'H'
,'2015-12-30': 'H'
,'2015-12-31': 'H'
}
var ban_hatsu = [
'2015-05-02'
,'2015-08-08'
,'2015-08-09'
,'2015-09-19'
,'2015-12-29'
,'2015-12-30'
]
var ban_chaku = [
'2015-01-03'
,'2015-01-04'
,'2015-05-05'
,'2015-05-06'
,'2015-08-15'
,'2015-08-16'
,'2015-09-22'
,'2015-09-23'
]
for (var month = 1; month <= 12; month++)
{
var tid = '#m' + ('0' + month).substr(-2,2);
$(tid + ' td').map(function(i,e){
e.setAttribute('year', year)
e.setAttribute('day', e.innerHTML)
e.setAttribute('month', month)
var key = year + '-' + ('0'+month).substr(-2,2) + '-' + ('0'+e.innerHTML).substr(-2,2);
e.setAttribute('ymd', key)
e.setAttribute('grade', daygrademap[key])
e.setAttribute('ban_hatsu', ban_hatsu.indexOf(key) >= 0 ? 'true': 'false')
e.setAttribute('ban_chaku', ban_chaku.indexOf(key) >= 0 ? 'true': 'false')
});
}
$('.calendar_container td[class!=empty]').map(function(i,e){
e.getAttribute
})
})
</script>
</head>
<body>
<table style="font-family: 'Meiryo UI'">
<tr>
<td colspan="4"><center style="font-weight:bold;border:solid 1px;" id="y"></center></td>
</tr>
<tr>
<td><div class="calendar_container" id="m01"></div></td>
<td><div class="calendar_container" id="m02"></div></td>
<td><div class="calendar_container" id="m03"></div></td>
<td><div class="calendar_container" id="m04"></div></td>
</tr>
<tr>
<td><div class="calendar_container" id="m05"></div></td>
<td><div class="calendar_container" id="m06"></div></td>
<td><div class="calendar_container" id="m07"></div></td>
<td><div class="calendar_container" id="m08"></div></td>
</tr>
<tr>
<td><div class="calendar_container" id="m09"></div></td>
<td><div class="calendar_container" id="m10"></div></td>
<td><div class="calendar_container" id="m11"></div></td>
<td><div class="calendar_container" id="m12"></div></td>
</tr>
</table>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment