From d9b8dee62feb4acd31e6a0932782cd6c076ce663 Mon Sep 17 00:00:00 2001 From: ujjwal2900 Date: Sun, 1 Sep 2024 22:37:14 +0530 Subject: [PATCH 1/4] Add Date and Time in UTC format to Feedback --- .../commons/feedback/FeedbackContentCreator.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/src/main/java/fr/free/nrw/commons/feedback/FeedbackContentCreator.java b/app/src/main/java/fr/free/nrw/commons/feedback/FeedbackContentCreator.java index 839858b3ec..367f4a0c79 100644 --- a/app/src/main/java/fr/free/nrw/commons/feedback/FeedbackContentCreator.java +++ b/app/src/main/java/fr/free/nrw/commons/feedback/FeedbackContentCreator.java @@ -6,6 +6,9 @@ import fr.free.nrw.commons.feedback.model.Feedback; import fr.free.nrw.commons.utils.LangCodeUtils; import java.util.Locale; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.TimeZone; /** * Creates a wikimedia recognizable format @@ -32,6 +35,12 @@ public void init() { /* * Construct the feedback section title */ + + //Get the UTC Date and Time + final SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss", Locale.ENGLISH); + dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); + final String UTC_FormattedDateTime = dateFormat.format(new Date()); + sectionTitleBuilder = new StringBuilder(); sectionTitleBuilder.append("Feedback from "); sectionTitleBuilder.append(AccountUtil.getUserName(context)); @@ -96,6 +105,11 @@ public void init() { } sectionTextBuilder.append("~~~~"); sectionTextBuilder.append("\n"); + + //Add the UTC Date and Time to Feedback + sectionTextBuilder.append("Generated on: "); + sectionTextBuilder.append(UTC_FormattedDateTime); + sectionTextBuilder.append("\n"); } public String getSectionText() { From e2cb091a0432920deb037fe29557cd937525ace4 Mon Sep 17 00:00:00 2001 From: ujjwal2900 Date: Sun, 8 Sep 2024 13:06:21 +0530 Subject: [PATCH 2/4] Add UTC date to the Subject instead of adding it to the body --- .../nrw/commons/feedback/FeedbackContentCreator.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/fr/free/nrw/commons/feedback/FeedbackContentCreator.java b/app/src/main/java/fr/free/nrw/commons/feedback/FeedbackContentCreator.java index 367f4a0c79..ac0dc25683 100644 --- a/app/src/main/java/fr/free/nrw/commons/feedback/FeedbackContentCreator.java +++ b/app/src/main/java/fr/free/nrw/commons/feedback/FeedbackContentCreator.java @@ -36,16 +36,18 @@ public void init() { * Construct the feedback section title */ - //Get the UTC Date and Time - final SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss", Locale.ENGLISH); + //Get the UTC Date and Time and add it to the Title + final SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy", Locale.ENGLISH); dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); - final String UTC_FormattedDateTime = dateFormat.format(new Date()); + final String UTC_FormattedDate = dateFormat.format(new Date()); sectionTitleBuilder = new StringBuilder(); sectionTitleBuilder.append("Feedback from "); sectionTitleBuilder.append(AccountUtil.getUserName(context)); sectionTitleBuilder.append(" for version "); sectionTitleBuilder.append(feedback.getVersion()); + sectionTitleBuilder.append(" on "); + sectionTitleBuilder.append(UTC_FormattedDate); /* * Construct the feedback section text @@ -106,10 +108,6 @@ public void init() { sectionTextBuilder.append("~~~~"); sectionTextBuilder.append("\n"); - //Add the UTC Date and Time to Feedback - sectionTextBuilder.append("Generated on: "); - sectionTextBuilder.append(UTC_FormattedDateTime); - sectionTextBuilder.append("\n"); } public String getSectionText() { From dac6474d3283df327ce83eb9d161cb8d1272d425 Mon Sep 17 00:00:00 2001 From: ujjwal2900 Date: Thu, 12 Sep 2024 08:55:57 +0530 Subject: [PATCH 3/4] Change the UTC Date format to yyyy/MM/dd HH:mm:ss --- .../fr/free/nrw/commons/feedback/FeedbackContentCreator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/fr/free/nrw/commons/feedback/FeedbackContentCreator.java b/app/src/main/java/fr/free/nrw/commons/feedback/FeedbackContentCreator.java index ac0dc25683..3fe5368fb1 100644 --- a/app/src/main/java/fr/free/nrw/commons/feedback/FeedbackContentCreator.java +++ b/app/src/main/java/fr/free/nrw/commons/feedback/FeedbackContentCreator.java @@ -37,7 +37,7 @@ public void init() { */ //Get the UTC Date and Time and add it to the Title - final SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy", Locale.ENGLISH); + final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss", Locale.ENGLISH); dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); final String UTC_FormattedDate = dateFormat.format(new Date()); @@ -49,7 +49,7 @@ public void init() { sectionTitleBuilder.append(" on "); sectionTitleBuilder.append(UTC_FormattedDate); - /* + /*of * Construct the feedback section text */ sectionTextBuilder = new StringBuilder(); From 3923d4ffa2d3aef48b3cbc7ddb2dc77acf028951 Mon Sep 17 00:00:00 2001 From: ujjwal2900 Date: Thu, 12 Sep 2024 09:02:00 +0530 Subject: [PATCH 4/4] Minor changes --- .../fr/free/nrw/commons/feedback/FeedbackContentCreator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/fr/free/nrw/commons/feedback/FeedbackContentCreator.java b/app/src/main/java/fr/free/nrw/commons/feedback/FeedbackContentCreator.java index 3fe5368fb1..1723da7238 100644 --- a/app/src/main/java/fr/free/nrw/commons/feedback/FeedbackContentCreator.java +++ b/app/src/main/java/fr/free/nrw/commons/feedback/FeedbackContentCreator.java @@ -49,7 +49,7 @@ public void init() { sectionTitleBuilder.append(" on "); sectionTitleBuilder.append(UTC_FormattedDate); - /*of + /* * Construct the feedback section text */ sectionTextBuilder = new StringBuilder();