This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git


The following commit(s) were added to refs/heads/master by this push:
     new 50ae50f  If there are emails (wrongly?) in the future, adjust the 
month so we can display everything up till now in sidebar cal
50ae50f is described below

commit 50ae50f0e18038b035e4ca4bd4c46e8c12edfa34
Author: Daniel Gruno <[email protected]>
AuthorDate: Sun Sep 12 15:19:40 2021 -0500

    If there are emails (wrongly?) in the future, adjust the month so we can 
display everything up till now in sidebar cal
---
 webui/js/source/sidebar-calendar.js | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/webui/js/source/sidebar-calendar.js 
b/webui/js/source/sidebar-calendar.js
index 1eb9bcb..2ee8ea3 100644
--- a/webui/js/source/sidebar-calendar.js
+++ b/webui/js/source/sidebar-calendar.js
@@ -32,6 +32,10 @@ function renderCalendar(FY, FM, LY, LM) {
     let CY = now.getFullYear();
     let CM = now.getMonth();
     let SY = Math.min(LY, CY); // last year in calendar, considering current 
date
+    // If Last Year is into the future, set Last Month to this one.
+    if (LY > CY) {
+        LM = CM;
+    }
 
     let cdiv = new HTML('div', { class: 'sidebar_calendar' })
     let N = 0;
@@ -119,4 +123,4 @@ function calendar_click(year, month) {
       window.history.pushState({}, null, newhref);
     }
     GET('%sapi/stats.lua?list=%s&domain=%s&d=%u-%u'.format(apiURL, 
current_list, current_domain, year, month), renderListView, {to: 
'%s@%s'.format(current_list, current_domain), update_calendar: false});
-}
\ No newline at end of file
+}

Reply via email to