Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added date and time to Feedback #5797

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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));
Expand Down Expand Up @@ -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");
Copy link
Member

@nicolas-raoul nicolas-raoul Sep 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be added to the title, rather than to the body section. So I suggest moving this to around line 49.
Also, to keep it concise, I suggest something shorter like just "on " + the date.

In the end, the title would look like this: Feedback from Nicolas for version 1.2.3 on 2023/12/31

Screenshot 2024-09-02 at 13 47 07

}

public String getSectionText() {
Expand Down
Loading