mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
* issue-#3195: order contribution list refactored * issue-#3195: ordered contribution list
This commit is contained in:
parent
b6df5f2a66
commit
bc8ce94d76
2 changed files with 12 additions and 2 deletions
|
|
@ -286,7 +286,7 @@ public class UploadService extends HandlerService<Contribution> {
|
|||
contribution.setFilename(canonicalFilename);
|
||||
contribution.setImageUrl(uploadResult.getImageinfo().getOriginalUrl());
|
||||
contribution.setState(Contribution.STATE_COMPLETED);
|
||||
contribution.setDateUploaded(CommonsDateUtil.getIso8601DateFormatShort()
|
||||
contribution.setDateUploaded(CommonsDateUtil.getIso8601DateFormatTimestamp()
|
||||
.parse(uploadResult.getImageinfo().getTimestamp()));
|
||||
compositeDisposable.add(contributionDao
|
||||
.save(contribution)
|
||||
|
|
|
|||
|
|
@ -13,11 +13,21 @@ public class CommonsDateUtil {
|
|||
|
||||
/**
|
||||
* Gets SimpleDateFormat for short date pattern
|
||||
* @return
|
||||
* @return simpledateformat
|
||||
*/
|
||||
public static SimpleDateFormat getIso8601DateFormatShort() {
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.ROOT);
|
||||
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
return simpleDateFormat;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the timestamp pattern for a date
|
||||
* @return timestamp
|
||||
*/
|
||||
public static SimpleDateFormat getIso8601DateFormatTimestamp() {
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.ROOT);
|
||||
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
return simpleDateFormat;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue