Faculty of Social Sciences

多様な学びの選択肢から、社会問題の解決に挑む

PickUP!自由を生き抜く実践知

新着一覧

これから行われるイベント・行事

\n'; result = result + '
\n'; result = result + '\n'; result = result + '\n'; $("#eventlist").append(result); }else{ var $eventlist = $('#eventlist').pagination({ itemElement : '.item', displayItemCount : 5, ellipsisMaxPageNumber : 5, firstEndPageBtnMode : true, changeStartCallback : function() { }, changeEndCallback : function() { } }); $('.item').on('click', function(e) { $eventlist.movePage(e.target.text); //return false; }); } } }); } function writeData(response){ var fix_date = response['fix_date']; var tag_id = []; var url_path = response['cPath']; var target_blank = ""; if(response['tag_ids']){ tag_id = response['tag_ids'].split(','); } if(response['link_url']){ url_path = response['link_url']; } if(response['link_target'] == '1'){ target_blank = 'target="_blank"'; } var result = '
  • \n'; result = result + '\n'; result = result + '
    \n'; result = result + '

    '+response['title']+'

    \n'; result = result + '
    \n'; result = result + '

    '+fix_date+" "+response['fixed_date_type']+'

    \n'; result = result + '
      \n'; result = result + '
    • '+grArray[response["group_id"]]+'
    • \n'; tag_id.forEach(function(v, i, a){ var tag = v.replace("/",""); tag = tag.replace("/",""); result = result + '
    • '+tgArray[tag]+'
    • \n'; }); result = result + '
    \n'; result = result + '
    \n'; result = result + '
    \n'; result = result + '
    \n'; result = result + '
  • \n'; return result; } const weeks = ['SUN', 'MON', 'TUE', 'WED', 'THE', 'FRI', 'SAT']; const date = new Date(); let year = date.getFullYear(); let month = date.getMonth() + 1; const config = { show: 1, } function showCalendar(year, month) { for ( i = 0; i < config.show; i++) { const calendarHtml = createCalendar(year, month); $('#calendar').append(calendarHtml); month++ if (month > 12) { year++; month = 1; } } $('.ico-arrow').bind('click', function(){ moveCalendar($(this).attr('id')); }); $('.fc-day').bind('click', function(){ var target_date = $(this).data('date'); var p = $("#event_top").offset().top; p = p-80; $('html,body').animate({ scrollTop: p }, 'slow'); $("#eventlist").empty(); event(target_date); }); /*$('#target_month').bind('click', function(){ target_month = $(this).data('month'); var p = $("#event_top").offset().top; p = p-80; $('html,body').animate({ scrollTop: p }, 'slow'); $("#eventlist").empty(); event(); });*/ } function createCalendar(year, month) { const startDate = new Date(year, month - 1, 1); // 月の最初の日を取得 const endDate = new Date(year, month, 0); // 月の最後の日を取得 const endDayCount = endDate.getDate(); // 月の末日 const lastMonthEndDate = new Date(year, month - 1, 0); // 前月の最後の日の情報 const lastMonthendDayCount = lastMonthEndDate.getDate(); // 前月の末日 const startDay = startDate.getDay(); // 月の最初の日の曜日を取得 let dayCount = 1; // 日にちのカウント let calendarHtml = ''; // HTMLを組み立てる変数 calendarHtml += ''; calendarHtml += ''; calendarHtml += '' calendarHtml += ''; calendarHtml += ''; // 曜日の行を作成 for (let i = 0; i < weeks.length; i++) { calendarHtml += ''; } for (let w = 0; w < 6; w++) { calendarHtml += ''; for (let d = 0; d < 7; d++) { var full_date = year+'-'+zeroPadding(month,2)+'-'+zeroPadding(dayCount,2); if (w == 0 && d < startDay) { // 1行目で1日の曜日の前 let num = lastMonthendDayCount - startDay + d + 1; calendarHtml += ''; } else if (dayCount > endDayCount) { // 末尾の日数を超えた let num = dayCount - endDayCount; calendarHtml += ''; dayCount++ } else if(today_date > full_date){ calendarHtml += ''; dayCount++ } else { calendarHtml += ''; dayCount++ } } calendarHtml += ''; } calendarHtml += '
    ' + year + '年' + month + '月' + '
    ' + weeks[i] + '
    ' + num + '' + num + '' + dayCount + '' + dayCount + '
    '; return calendarHtml; } function moveCalendar(e) { $("#calendar").empty(); if (e === 'prev') { month--; if (month < 1) { year--; month = 12; } } if (e === 'next') { month++; if (month > 12) { year++; month = 1; } } showCalendar(year, month); } function zeroPadding(number, length){ return (Array(length).join('0') + number).slice(-length); } showCalendar(year, month) });

    社会学部をもっと知る