Browse Source

Fixed date alignement bug.

master
Christian P. MOMON 2 years ago
parent
commit
7a770e562b
  1. 12
      src/org/april/agirstatool/core/AgirStatool.java
  2. 6
      src/org/april/agirstatool/core/AgirStatoolUtils.java
  3. 2
      src/org/april/agirstatool/core/pages/CreatedConcludedCountChartView.java
  4. 2
      src/org/april/agirstatool/core/pages/chartLineView.xhtml

12
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 ");

6
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)
{

2
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);

2
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)',

Loading…
Cancel
Save