asia_Kstyle3/modules/announcement/annc_index4.html.erb

38 lines
1.2 KiB
Plaintext

<div class="i-annc index-announcement-4">
<h3 class="i-annc__page-title">{{page-title}}</h3>
<ul class="i-annc__list" data-level="0" data-list="announcements">
<li class="i-annc__item row">
<span class="i-annc__postdate-wrap col-sm-3" date-format="%Y-%m/%d">
<span class="i-annc__postdate">{{postdate}}</span>
</span>
<h4 class="i-annc__entry-title col-sm-9">
<span class="i-annc__status-wrap" data-list="statuses" data-level="1">
<span class="i-annc__status label status {{status-class}}">{{status}}</span>
</span>
<a class="i-annc__title" href="{{link_to_show}}">{{title}}</a>
</h4>
</li>
</ul>
</div>
{{pagination_goes_here}}
<script>
function postdate() {
var len = $('.i-annc__postdate').length;
var date = $('.i-annc__postdate');
for (let i=0; i<len; i++) {
newDate = date[i].innerText.slice(5,10)
newYear = date[i].innerText.slice(0,5)
date[i].innerHTML= '';
date[i].append(newYear)
var date2 = document.createElement('span');
date2.className = 'new-date';
date2.textContent = newDate;
date[i].appendChild(date2);
}
}
postdate();
</script>