File tree 4 files changed +12
-16
lines changed
app/src/main/java/fr/free/nrw/commons
4 files changed +12
-16
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 21
21
import com .google .android .material .floatingactionbutton .FloatingActionButton ;
22
22
23
23
import java .util .ArrayList ;
24
- import java .util .Collections ;
25
24
import java .util .List ;
26
25
27
26
import javax .inject .Inject ;
@@ -186,8 +185,6 @@ public void showNoContributionsUI(boolean shouldShow) {
186
185
}
187
186
188
187
public void setContributions (List <Contribution > contributionList ) {
189
- Collections .sort (contributionList , new ContributionComparator ());
190
- Collections .reverse (contributionList );
191
188
this .contributions .clear ();
192
189
this .contributions .addAll (contributionList );
193
190
adapter .setContributions (contributions );
Original file line number Diff line number Diff line change @@ -285,7 +285,7 @@ private void uploadContribution(Contribution contribution) {
285
285
contribution .setFilename (canonicalFilename );
286
286
contribution .setImageUrl (uploadResult .getImageinfo ().getOriginalUrl ());
287
287
contribution .setState (Contribution .STATE_COMPLETED );
288
- contribution .setDateUploaded (CommonsDateUtil .getIso8601DateFormatShort ()
288
+ contribution .setDateUploaded (CommonsDateUtil .getIso8601DateFormatTimestamp ()
289
289
.parse (uploadResult .getImageinfo ().getTimestamp ()));
290
290
compositeDisposable .add (contributionDao
291
291
.save (contribution )
Original file line number Diff line number Diff line change @@ -13,11 +13,21 @@ public class CommonsDateUtil {
13
13
14
14
/**
15
15
* Gets SimpleDateFormat for short date pattern
16
- * @return
16
+ * @return simpledateformat
17
17
*/
18
18
public static SimpleDateFormat getIso8601DateFormatShort () {
19
19
SimpleDateFormat simpleDateFormat = new SimpleDateFormat ("yyyy-MM-dd" , Locale .ROOT );
20
20
simpleDateFormat .setTimeZone (TimeZone .getTimeZone ("UTC" ));
21
21
return simpleDateFormat ;
22
22
}
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
+ }
23
33
}
You can’t perform that action at this time.
0 commit comments