File tree 2 files changed +12
-2
lines changed
app/src/main/java/fr/free/nrw/commons
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -286,7 +286,7 @@ private void uploadContribution(Contribution contribution) {
286
286
contribution .setFilename (canonicalFilename );
287
287
contribution .setImageUrl (uploadResult .getImageinfo ().getOriginalUrl ());
288
288
contribution .setState (Contribution .STATE_COMPLETED );
289
- contribution .setDateUploaded (CommonsDateUtil .getIso8601DateFormatShort ()
289
+ contribution .setDateUploaded (CommonsDateUtil .getIso8601DateFormatTimestamp ()
290
290
.parse (uploadResult .getImageinfo ().getTimestamp ()));
291
291
compositeDisposable .add (contributionDao
292
292
.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