From 05a5a5214966774d3980b1b769314b9f55706c1a Mon Sep 17 00:00:00 2001 From: Mike Irving Date: Sat, 6 Jan 2024 15:12:28 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20show=202024=20on=20footage=20page=20?= =?UTF-8?q?=F0=9F=A6=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/scripts.js | 66 +++++++++++++++++++++++++-------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/js/scripts.js b/js/scripts.js index b4d46e7..fadd54a 100644 --- a/js/scripts.js +++ b/js/scripts.js @@ -218,6 +218,11 @@ function OutputYearsAndMonths(specificYear) { years.push(year); }); + if(!years.indexOf(monthNotes[0].year.toString()) > -1) { + years.push(monthNotes[0].year.toString()); + years = years.sort().reverse(); + } + if(years.length > 0) { if(IsNullOrEmpty(specificYear)) { $("#h1").text("All Footage"); @@ -266,40 +271,37 @@ function OutputYearsAndMonths(specificYear) { months.push(month) }); - if(months.length > 0) { - html += - "" + - "" + - "" + - "" + - "" + - "" - "" - ""; - - for(var i = 0; i < 12; i++) { - html += - ""; - - if(parseInt( (i+1) / 4 ) == ((i+1) / 4)) - html += ""; - } + html += + "
" + - ((IsNullOrEmpty(specificYear))? - "" + year + "" - : - year - ) + - "
" + - (((months.indexOf(PadNumber(i + 1)) > -1) || (monthNotes.filter(x => x.year == parseInt(year) && x.month == (i + 1)).length > 0))? "" : "") + - "
" + monthNames[i] + "" + monthNamesShort[i] + "
" + - "
" + - ((months.indexOf(PadNumber(i + 1)) > -1)? "
" : "")+ - "
" + + "" + + "" + + "" + + "" + + "" + "" + ""; - html += "" + - "
" + + ((IsNullOrEmpty(specificYear))? + "" + year + "" + : + year + ) + + "
"; + for(var i = 0; i < 12; i++) { + html += + "" + + (((months.indexOf(PadNumber(i + 1)) > -1) || (monthNotes.filter(x => x.year == parseInt(year) && x.month == (i + 1)).length > 0))? "" : "") + + "
" + monthNames[i] + "" + monthNamesShort[i] + "
" + + "
" + + ((months.indexOf(PadNumber(i + 1)) > -1)? "
" : "")+ + ""; + if(parseInt( (i+1) / 4 ) == ((i+1) / 4)) + html += ""; } + + html += "" + + ""; }); if(!IsNullOrEmpty(specificYear)) @@ -350,8 +352,6 @@ function OutputMonth(specificYear, specificMonth) { html += ""; - - if(monthFeed.length > 0){ var startDay = new Date(specificYear + "-" + specificMonth + "-01").getDay();