mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
* issue-#3195: order contribution list refactored * issue-#3195: ordered contribution list
This commit is contained in:
parent
eb88e58ec0
commit
80530663a1
2 changed files with 12 additions and 2 deletions
|
|
@ -286,7 +286,7 @@ public class UploadService extends HandlerService<Contribution> {
|
||||||
contribution.setFilename(canonicalFilename);
|
contribution.setFilename(canonicalFilename);
|
||||||
contribution.setImageUrl(uploadResult.getImageinfo().getOriginalUrl());
|
contribution.setImageUrl(uploadResult.getImageinfo().getOriginalUrl());
|
||||||
contribution.setState(Contribution.STATE_COMPLETED);
|
contribution.setState(Contribution.STATE_COMPLETED);
|
||||||
contribution.setDateUploaded(CommonsDateUtil.getIso8601DateFormatShort()
|
contribution.setDateUploaded(CommonsDateUtil.getIso8601DateFormatTimestamp()
|
||||||
.parse(uploadResult.getImageinfo().getTimestamp()));
|
.parse(uploadResult.getImageinfo().getTimestamp()));
|
||||||
compositeDisposable.add(contributionDao
|
compositeDisposable.add(contributionDao
|
||||||
.save(contribution)
|
.save(contribution)
|
||||||
|
|
|
||||||
|
|
@ -13,11 +13,21 @@ public class CommonsDateUtil {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets SimpleDateFormat for short date pattern
|
* Gets SimpleDateFormat for short date pattern
|
||||||
* @return
|
* @return simpledateformat
|
||||||
*/
|
*/
|
||||||
public static SimpleDateFormat getIso8601DateFormatShort() {
|
public static SimpleDateFormat getIso8601DateFormatShort() {
|
||||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.ROOT);
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.ROOT);
|
||||||
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
|
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||||
return simpleDateFormat;
|
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