community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject svn commit: r1864322 - in /comdev/reporter.apache.org/trunk/site/wizard/js: source/generators.js wizard.js
Date Sat, 03 Aug 2019 08:03:18 GMT
Author: humbedooh
Date: Sat Aug  3 08:03:18 2019
New Revision: 1864322

URL: http://svn.apache.org/viewvc?rev=1864322&view=rev
Log:
sort so we only pick the latest releases

Modified:
    comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js
    comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js

Modified: comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js?rev=1864322&r1=1864321&r2=1864322&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js Sat Aug  3 08:03:18
2019
@@ -292,16 +292,21 @@ function activity_tips(data) {
     // Releases
     let rtxt = "";
     let new_releases = 0;
+    let ages = [];
     for (var rel in data.releases[project]) {
         let reldate = moment(data.releases[project][rel] * 1000.0);
         if (reldate > three_months_ago) {
           new_releases++;
         }
+        ages.push(reldate.unix());
     }
+    ages.sort().reverse();
+    ages = ages.splice(0,6);
+    console.log(ages)
     let releases_shown = 0;
-    for (var rel in data.releases[project].reverse()) {
+    for (var rel in data.releases[project]) {
         let reldate = moment(data.releases[project][rel] * 1000.0);
-        if (reldate > three_months_ago || (new_releases < 3 && releases_shown
< 3)) {
+        if (reldate > three_months_ago || (new_releases < 3 && releases_shown
< 3 && ages.has(reldate.unix()))) {
             rtxt += "<li>%s was released on %s.</li>".format(rel, reldate.format('YYYY-MM-DD'));
             releases_shown++;
         }

Modified: comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js?rev=1864322&r1=1864321&r2=1864322&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js Sat Aug  3 08:03:18 2019
@@ -1461,16 +1461,21 @@ function activity_tips(data) {
     // Releases
     let rtxt = "";
     let new_releases = 0;
+    let ages = [];
     for (var rel in data.releases[project]) {
         let reldate = moment(data.releases[project][rel] * 1000.0);
         if (reldate > three_months_ago) {
           new_releases++;
         }
+        ages.push(reldate.unix());
     }
+    ages.sort().reverse();
+    ages = ages.splice(0,6);
+    console.log(ages)
     let releases_shown = 0;
-    for (var rel in data.releases[project].reverse()) {
+    for (var rel in data.releases[project]) {
         let reldate = moment(data.releases[project][rel] * 1000.0);
-        if (reldate > three_months_ago || (new_releases < 3 && releases_shown
< 3)) {
+        if (reldate > three_months_ago || (new_releases < 3 && releases_shown
< 3 && ages.has(reldate.unix()))) {
             rtxt += "<li>%s was released on %s.</li>".format(rel, reldate.format('YYYY-MM-DD'));
             releases_shown++;
         }



Mime
View raw message