mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Added date and time to Feedback (#5797)
* Add Date and Time in UTC format to Feedback * Add UTC date to the Subject instead of adding it to the body * Change the UTC Date format to yyyy/MM/dd HH:mm:ss * Minor changes --------- Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
This commit is contained in:
parent
c3cd30ce5c
commit
9393dda9a4
1 changed files with 12 additions and 0 deletions
|
|
@ -6,6 +6,9 @@ import fr.free.nrw.commons.auth.AccountUtil;
|
|||
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,11 +35,19 @@ public class FeedbackContentCreator {
|
|||
/*
|
||||
* Construct the feedback section title
|
||||
*/
|
||||
|
||||
//Get the UTC Date and Time and add it to the Title
|
||||
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());
|
||||
|
||||
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
|
||||
|
|
@ -96,6 +107,7 @@ public class FeedbackContentCreator {
|
|||
}
|
||||
sectionTextBuilder.append("~~~~");
|
||||
sectionTextBuilder.append("\n");
|
||||
|
||||
}
|
||||
|
||||
public String getSectionText() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue