From 7a770e562b79a97221c0af6942b8f2170ad6efe5 Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Wed, 22 Jan 2020 11:11:14 +0100 Subject: [PATCH] Fixed date alignement bug. --- src/org/april/agirstatool/core/AgirStatool.java | 12 ++++++------ src/org/april/agirstatool/core/AgirStatoolUtils.java | 6 +++--- .../core/pages/CreatedConcludedCountChartView.java | 2 +- .../april/agirstatool/core/pages/chartLineView.xhtml | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/org/april/agirstatool/core/AgirStatool.java b/src/org/april/agirstatool/core/AgirStatool.java index c62c6a6..e934b7d 100644 --- a/src/org/april/agirstatool/core/AgirStatool.java +++ b/src/org/april/agirstatool/core/AgirStatool.java @@ -207,10 +207,10 @@ public class AgirStatool for (Project subProject : project.subProjects()) { refreshPage(subProject); - if (project.getName().equals("Chapril")) - { - System.exit(0); - } + // if (project.getName().equals("Chapril")) + // { + // System.exit(0); + // } } } } @@ -271,7 +271,7 @@ public class AgirStatool StringList sql = new StringList(); 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("FROM "); sql.append(" issues "); @@ -353,7 +353,7 @@ public class AgirStatool StringList sql = new StringList(); 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("FROM "); sql.append(" issues "); diff --git a/src/org/april/agirstatool/core/AgirStatoolUtils.java b/src/org/april/agirstatool/core/AgirStatoolUtils.java index b3a37b5..e2067f6 100644 --- a/src/org/april/agirstatool/core/AgirStatoolUtils.java +++ b/src/org/april/agirstatool/core/AgirStatoolUtils.java @@ -89,14 +89,14 @@ public class AgirStatoolUtils LocalDate normalizedEnd = normaliseWeekDate(end); 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) { index = 0; } 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; if (index < source.size()) { @@ -144,7 +144,7 @@ public class AgirStatoolUtils long count = 0; 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); if (current != null) { diff --git a/src/org/april/agirstatool/core/pages/CreatedConcludedCountChartView.java b/src/org/april/agirstatool/core/pages/CreatedConcludedCountChartView.java index e891043..e4369cb 100644 --- a/src/org/april/agirstatool/core/pages/CreatedConcludedCountChartView.java +++ b/src/org/april/agirstatool/core/pages/CreatedConcludedCountChartView.java @@ -109,7 +109,7 @@ public class CreatedConcludedCountChartView { 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 code = XidynUtils.extractBodyContent(source); diff --git a/src/org/april/agirstatool/core/pages/chartLineView.xhtml b/src/org/april/agirstatool/core/pages/chartLineView.xhtml index fdf4f4b..7277888 100644 --- a/src/org/april/agirstatool/core/pages/chartLineView.xhtml +++ b/src/org/april/agirstatool/core/pages/chartLineView.xhtml @@ -35,7 +35,7 @@ var myChart = new Chart(ctx, pointBorderWidth: 0.00000001 }, { - label: 'Closed', + label: 'Concluded', data: [1, 5, 9, 13, 15, 22] , backgroundColor: 'rgba(75, 192, 192, 0.2)', borderColor: 'rgba(75, 192, 192, 1)',