From aa99ddf05831e8e00eb58512f5b07975fed2ecd0 Mon Sep 17 00:00:00 2001 From: Vito Conforti Date: Tue, 22 Aug 2023 14:34:03 +0200 Subject: [PATCH] added last update date --- nb-configuration.xml | 18 +++++++++++++++ nbactions-release-profile.xml | 6 ++--- .../mycompany/gitissueman/GitIssueMan.java | 23 ++++++++++++------- 3 files changed, 36 insertions(+), 11 deletions(-) create mode 100644 nb-configuration.xml diff --git a/nb-configuration.xml b/nb-configuration.xml new file mode 100644 index 0000000..0a1a2eb --- /dev/null +++ b/nb-configuration.xml @@ -0,0 +1,18 @@ + + + + + + all + + diff --git a/nbactions-release-profile.xml b/nbactions-release-profile.xml index d6edb04..af68254 100644 --- a/nbactions-release-profile.xml +++ b/nbactions-release-profile.xml @@ -13,7 +13,7 @@ ${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs} 4 - ${packageClassName} + com.mycompany.gitissueman.GitIssueMan java @@ -30,7 +30,7 @@ -agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address} ${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs} 4 - ${packageClassName} + com.mycompany.gitissueman.GitIssueMan java true @@ -47,7 +47,7 @@ ${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs} - ${packageClassName} + com.mycompany.gitissueman.GitIssueMan java 4 diff --git a/src/main/java/com/mycompany/gitissueman/GitIssueMan.java b/src/main/java/com/mycompany/gitissueman/GitIssueMan.java index b7989b5..abb03bf 100644 --- a/src/main/java/com/mycompany/gitissueman/GitIssueMan.java +++ b/src/main/java/com/mycompany/gitissueman/GitIssueMan.java @@ -21,6 +21,8 @@ import com.google.gson.JsonSyntaxException; import java.io.IOException; import java.net.MalformedURLException; import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; @@ -412,15 +414,11 @@ public class GitIssueMan { }else{ //System.out.println(issueObject.get("id").getAsString() + " Not processed due to missing information (due date or last update) " ); - } - - - + } total_issue ++; - - } - } - + } + + } } // Check if there are more pages to read @@ -546,6 +544,14 @@ public class GitIssueMan { private static void publish_redmine_test(String apiUrl) throws IOException { + LocalDateTime currentDateTime = LocalDateTime.now(); + // Define a formatter to display the date and time in a specific format + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + // Format the current date and time using the formatter + String formattedDateTime = currentDateTime.format(formatter); + + + /* String redmine = "h1. Dormient issues \\n \\n"; redmine = redmine + fetchIssuesRecursively_3(apiUrl); @@ -561,6 +567,7 @@ public class GitIssueMan { redmine = redmine + fetchIssuesRecursively_2(apiUrl); redmine = redmine + "

Incomplete issues


"; redmine = redmine + fetchIssuesRecursively_1(apiUrl); + redmine = redmine + "

Last update: " + formattedDateTime + "


"; redmine = redmine.replace("\"", "\\\""); try { // Set the API endpoint URL to update the Wiki page content -- GitLab