mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-31 23:03:54 +01:00
Add Date and Time in UTC format to Feedback
This commit is contained in:
parent
62d6dea219
commit
d9b8dee62f
1 changed files with 14 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.feedback.model.Feedback;
|
||||||
import fr.free.nrw.commons.utils.LangCodeUtils;
|
import fr.free.nrw.commons.utils.LangCodeUtils;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a wikimedia recognizable format
|
* Creates a wikimedia recognizable format
|
||||||
|
|
@ -32,6 +35,12 @@ public class FeedbackContentCreator {
|
||||||
/*
|
/*
|
||||||
* Construct the feedback section title
|
* 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 = new StringBuilder();
|
||||||
sectionTitleBuilder.append("Feedback from ");
|
sectionTitleBuilder.append("Feedback from ");
|
||||||
sectionTitleBuilder.append(AccountUtil.getUserName(context));
|
sectionTitleBuilder.append(AccountUtil.getUserName(context));
|
||||||
|
|
@ -96,6 +105,11 @@ public class FeedbackContentCreator {
|
||||||
}
|
}
|
||||||
sectionTextBuilder.append("~~~~");
|
sectionTextBuilder.append("~~~~");
|
||||||
sectionTextBuilder.append("\n");
|
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() {
|
public String getSectionText() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue