File tree Expand file tree Collapse file tree 4 files changed +12
-16
lines changed
app/src/main/java/fr/free/nrw/commons Expand file tree Collapse file tree 4 files changed +12
-16
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 2121import com .google .android .material .floatingactionbutton .FloatingActionButton ;
2222
2323import java .util .ArrayList ;
24- import java .util .Collections ;
2524import java .util .List ;
2625
2726import javax .inject .Inject ;
@@ -186,8 +185,6 @@ public void showNoContributionsUI(boolean shouldShow) {
186185 }
187186
188187 public void setContributions (List <Contribution > contributionList ) {
189- Collections .sort (contributionList , new ContributionComparator ());
190- Collections .reverse (contributionList );
191188 this .contributions .clear ();
192189 this .contributions .addAll (contributionList );
193190 adapter .setContributions (contributions );
Original file line number Diff line number Diff line change @@ -285,7 +285,7 @@ private void uploadContribution(Contribution contribution) {
285285 contribution .setFilename (canonicalFilename );
286286 contribution .setImageUrl (uploadResult .getImageinfo ().getOriginalUrl ());
287287 contribution .setState (Contribution .STATE_COMPLETED );
288- contribution .setDateUploaded (CommonsDateUtil .getIso8601DateFormatShort ()
288+ contribution .setDateUploaded (CommonsDateUtil .getIso8601DateFormatTimestamp ()
289289 .parse (uploadResult .getImageinfo ().getTimestamp ()));
290290 compositeDisposable .add (contributionDao
291291 .save (contribution )
Original file line number Diff line number Diff line change @@ -13,11 +13,21 @@ public class CommonsDateUtil {
1313
1414 /**
1515 * Gets SimpleDateFormat for short date pattern
16- * @return
16+ * @return simpledateformat
1717 */
1818 public static SimpleDateFormat getIso8601DateFormatShort () {
1919 SimpleDateFormat simpleDateFormat = new SimpleDateFormat ("yyyy-MM-dd" , Locale .ROOT );
2020 simpleDateFormat .setTimeZone (TimeZone .getTimeZone ("UTC" ));
2121 return simpleDateFormat ;
2222 }
23+
24+ /**
25+ * Gets the timestamp pattern for a date
26+ * @return timestamp
27+ */
28+ public static SimpleDateFormat getIso8601DateFormatTimestamp () {
29+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss" , Locale .ROOT );
30+ simpleDateFormat .setTimeZone (TimeZone .getTimeZone ("UTC" ));
31+ return simpleDateFormat ;
32+ }
2333}
You can’t perform that action at this time.
0 commit comments