1. Partial fix for NIHVIVO-2150. This will make sure that there is no downward curve for the sparklines for the current year. Only last 10 complete years are considered. e..g it is 15th april, 2011 today, sparkline will consider only publications that have dates before/on 31st december, 2010

This commit is contained in:
cdtank 2011-04-14 15:19:05 +00:00
parent 1e55fe9f1f
commit 58976b5d99
4 changed files with 28 additions and 4 deletions

View file

@ -71,7 +71,13 @@ public class CoAuthorshipVisCodeGenerator {
SparklineData sparklineData = new SparklineData();
int numOfYearsToBeRendered = 0;
int currentYear = Calendar.getInstance().get(Calendar.YEAR);
/*
* It was decided that to prevent downward curve that happens if there are no publications
* in the current year seems a bit harsh, so we consider only publications from the last 10
* complete years.
* */
int currentYear = Calendar.getInstance().get(Calendar.YEAR) - 1;
int shortSparkMinYear = currentYear
- VisConstants.MINIMUM_YEARS_CONSIDERED_FOR_SPARKLINE
+ 1;

View file

@ -78,7 +78,13 @@ public class CoPIVisCodeGenerator {
SparklineData sparklineData = new SparklineData();
int numOfYearsToBeRendered = 0;
int currentYear = Calendar.getInstance().get(Calendar.YEAR);
/*
* It was decided that to prevent downward curve that happens if there are no publications
* in the current year seems a bit harsh, so we consider only publications from the last 10
* complete years.
* */
int currentYear = Calendar.getInstance().get(Calendar.YEAR) - 1;
int shortSparkMinYear = currentYear
- VisConstants.MINIMUM_YEARS_CONSIDERED_FOR_SPARKLINE + 1;

View file

@ -72,7 +72,13 @@ public class PersonGrantCountVisCodeGenerator {
sparklineData.setYearToActivityCount(yearToGrantCount);
int numOfYearsToBeRendered = 0;
int currentYear = Calendar.getInstance().get(Calendar.YEAR);
/*
* It was decided that to prevent downward curve that happens if there are no publications
* in the current year seems a bit harsh, so we consider only publications from the last 10
* complete years.
* */
int currentYear = Calendar.getInstance().get(Calendar.YEAR) - 1;
int shortSparkMinYear = currentYear
- VisConstants.MINIMUM_YEARS_CONSIDERED_FOR_SPARKLINE + 1;

View file

@ -74,7 +74,13 @@ public class PersonPublicationCountVisCodeGenerator {
int numOfYearsToBeRendered = 0;
int currentYear = Calendar.getInstance().get(Calendar.YEAR);
/*
* It was decided that to prevent downward curve that happens if there are no publications
* in the current year seems a bit harsh, so we consider only publications from the last 10
* complete years.
* */
int currentYear = Calendar.getInstance().get(Calendar.YEAR) - 1;
int shortSparkMinYear = currentYear
- VisConstants.MINIMUM_YEARS_CONSIDERED_FOR_SPARKLINE
+ 1;