Fixed date alignement bug.

This commit is contained in:
Christian P. MOMON 2020-01-22 11:11:14 +01:00
parent efd8193009
commit 7a770e562b
4 changed files with 11 additions and 11 deletions

View File

@ -207,10 +207,10 @@ public class AgirStatool
for (Project subProject : project.subProjects()) for (Project subProject : project.subProjects())
{ {
refreshPage(subProject); refreshPage(subProject);
if (project.getName().equals("Chapril")) // if (project.getName().equals("Chapril"))
{ // {
System.exit(0); // System.exit(0);
} // }
} }
} }
} }
@ -271,7 +271,7 @@ public class AgirStatool
StringList sql = new StringList(); StringList sql = new StringList();
sql.append("SELECT"); sql.append("SELECT");
sql.append(" concat_ws('-', year(closed_on), month(closed_on), weekofyear(closed_on)) as date, "); sql.append(" yearweek(closed_on, 3) as date, ");
sql.append(" count(*) as count "); sql.append(" count(*) as count ");
sql.append("FROM "); sql.append("FROM ");
sql.append(" issues "); sql.append(" issues ");
@ -353,7 +353,7 @@ public class AgirStatool
StringList sql = new StringList(); StringList sql = new StringList();
sql.append("SELECT "); sql.append("SELECT ");
sql.append(" concat_ws('-', year(created_on), month(created_on), weekofyear(created_on)) as date, "); sql.append(" yearweek(created_on,3) as date, ");
sql.append(" count(*) as count "); sql.append(" count(*) as count ");
sql.append("FROM "); sql.append("FROM ");
sql.append(" issues "); sql.append(" issues ");

View File

@ -89,14 +89,14 @@ public class AgirStatoolUtils
LocalDate normalizedEnd = normaliseWeekDate(end); LocalDate normalizedEnd = normaliseWeekDate(end);
LocalDate date = normaliseWeekDate(start); LocalDate date = normaliseWeekDate(start);
int index = source.indexOf(start.format(DateTimeFormatter.ofPattern("yyyy-M-w"))); int index = source.indexOf(start.format(DateTimeFormatter.ofPattern("yyyyw")));
if (index == -1) if (index == -1)
{ {
index = 0; index = 0;
} }
while (date.isBefore(normalizedEnd) || date.isEqual(normalizedEnd)) while (date.isBefore(normalizedEnd) || date.isEqual(normalizedEnd))
{ {
String dateToken = date.format(DateTimeFormatter.ofPattern("yyyy-M-w")); String dateToken = date.format(DateTimeFormatter.ofPattern("yyyyw"));
long count; long count;
if (index < source.size()) if (index < source.size())
{ {
@ -144,7 +144,7 @@ public class AgirStatoolUtils
long count = 0; long count = 0;
while (date.isBefore(end) || date.isEqual(end)) while (date.isBefore(end) || date.isEqual(end))
{ {
String dateToken = date.format(DateTimeFormatter.ofPattern("yyyy-M-w")); String dateToken = date.format(DateTimeFormatter.ofPattern("yyyyw"));
DateCount current = source.get(dateToken); DateCount current = source.get(dateToken);
if (current != null) if (current != null)
{ {

View File

@ -109,7 +109,7 @@ public class CreatedConcludedCountChartView
{ {
logger.info("Building created/closed x months chart view…"); logger.info("Building created/closed x months chart view…");
if (project.hasIssue() && !project.getName().equals("*")) if (project.hasIssue())
{ {
String source = XidynUtils.load(AgirStatool.class.getResource("/org/april/agirstatool/core/pages/chartLineView.xhtml")); String source = XidynUtils.load(AgirStatool.class.getResource("/org/april/agirstatool/core/pages/chartLineView.xhtml"));
String code = XidynUtils.extractBodyContent(source); String code = XidynUtils.extractBodyContent(source);

View File

@ -35,7 +35,7 @@ var myChart = new Chart(ctx,
pointBorderWidth: 0.00000001 pointBorderWidth: 0.00000001
}, },
{ {
label: 'Closed', label: 'Concluded',
data: [1, 5, 9, 13, 15, 22] , data: [1, 5, 9, 13, 15, 22] ,
backgroundColor: 'rgba(75, 192, 192, 0.2)', backgroundColor: 'rgba(75, 192, 192, 0.2)',
borderColor: 'rgba(75, 192, 192, 1)', borderColor: 'rgba(75, 192, 192, 1)',