$(function () { $.getJSON("https://search-api.nfhsnetwork.com/views/events/upcoming?size=4", function (data) { var str = ''; $.each(data.items, function (i, item) { var date = formatDate(new Date(item.start_time)); str += '
' + str + '
'; } $('#networkUpcoming').html(str); }); // Get NFHS Network Highlights $.getJSON("https://search-api.nfhsnetwork.com/views/highlights?size=4", function (data) { var str = ''; $.each(data.items, function (i, item) { var date = formatDate(new Date(item.created_at)); str += '' + str + '
'; } $('#networkHighlights').html(str); }); // Get NFHS Network Live $.getJSON("https://search-api.nfhsnetwork.com/views/events/live?size=3", function (data) { var str = ''; $.each(data.items, function (i, item) { var date = formatDate(new Date(item.start_time)); str += '' + str + '
'; } $('#networkLive').html(str); }); //$('.networkTabs').cycle(); //$('.videoTabsWrapper').cycle(); }); function formatDate(val) { var date = new Date(val); var options = { //weekday: 'short', year: 'numeric', month: 'short', day: 'numeric', hour: 'numeric', minute: 'numeric', timeZoneName: 'short' } return date.toLocaleTimeString(navigator.language, options); }