$(function(){
$.get('fireworks2017.csv',function(data){
var csv = $.csv()(data);
count = 0;
$("#csv_pc").append("
");
$("#csv_pc").append("開催日時・名称・場所 | 打ち上げ数 | 備考(人出、大会の内容等) |
");
$(csv).each(function(){
if(this[2] === pref){
count++;
var insert_pc = '';
var insert_smt = '';
NowDate = new Date();
/*NowDate = new Date("2015/07/25 21:30:00");*/
CloseDate01 = new Date(this[13]);
CloseDate02 = new Date(this[16]);
CloseDate03 = new Date(this[19]);
insert_pc += ""+this[2]+"・"+this[3]+" "+this[5]+" "+this[6]+" "+this[7]+" | ";
insert_smt += "
開催日時 名称 場所 | "+this[2]+"・"+this[3]+" "+this[5]+" "+this[6]+" "+this[7]+" |
---|
打ち上げ数 | ";
if(this[9]){
insert_pc += "約"+this[9]+"発 | "+this[10]+"
";
insert_smt += " | 約"+this[9]+"発 |
---|
備考(人出、大会の内容等) | "+this[10]+"
";
} else {
insert_pc += " | 未定 | "+this[10]+"
";
insert_smt += " | 未定 |
---|
備考(人出、大会の内容等) | "+this[10]+"
";
}
if((this[12])&&(Number(NowDate) < Number(CloseDate01))){
insert_pc += "★"+this[14]+"";
insert_smt += "★"+this[14]+"";
}
if((this[15])&&(Number(NowDate) < Number(CloseDate02))){
insert_pc += "★"+this[17]+"";
insert_smt += "★"+this[17]+"";
}
if((this[18])&&(Number(NowDate) < Number(CloseDate03))){
insert_pc += "★"+this[20]+"";
insert_smt += "★"+this[20]+"";
}
insert_pc += " |
";
insert_smt += "";
$("#csv_pc").append(insert_pc);
$("#csv_smt").append(insert_smt);
}
});
$("#count").append(count);
// set background-color
$("#csv_smt tr").each(function (i) {
if(Math.floor(i/3)%2 <= 0){
$(this).find('td').css({'background-color':'#eaecf0'});
}
});
});
});