$(document).ready(function() { function monthToNumber(monthName) { const months = { 'ян.': 0, 'фев.': 1, 'март': 2, 'апр.': 3, 'май': 4, 'юни': 5, 'юли': 6, 'авг.': 7, 'сеп.': 8, 'окт.': 9, 'ноем.': 10, 'дек.': 11 }; return months[monthName]; } const events = $(".item-event").toArray().sort((a, b) => { const dateA = parseInt($(a).find('.date').text()); const monthA = monthToNumber($(a).find('.month').text().trim()); const dateB = parseInt($(b).find('.date').text()); const monthB = monthToNumber($(b).find('.month').text().trim()); if (monthA !== monthB) { return monthA - monthB; } return dateA - dateB; }); $(".thim-list-event").empty().append(events); });
Back
Велин Филипов

Велин Филипов

Лектор

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry’s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.

Други членове

    ФОРМА ЗА ОБРАТНА ВРЪЗКА