Skip to content

Commit f03cd1d

Browse files
committed
issue-#3195: change format of getDateUploaded refactored
1 parent 208e278 commit f03cd1d

File tree

4 files changed

+6
-11
lines changed

4 files changed

+6
-11
lines changed

app/src/main/java/fr/free/nrw/commons/Media.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -347,14 +347,7 @@ public void setDateCreated(Date date) {
347347
*/
348348
public @Nullable
349349
Date getDateUploaded() {
350-
String date = CommonsDateUtil.getIso8601DateFormatShort().format(dateUploaded);
351-
Date uploadDate = dateUploaded;
352-
try {
353-
uploadDate = CommonsDateUtil.getIso8601DateFormatShort().parse(date);
354-
} catch (ParseException e) {
355-
e.printStackTrace();
356-
}
357-
return uploadDate;
350+
return dateUploaded;
358351
}
359352

360353
/**

app/src/main/java/fr/free/nrw/commons/contributions/ContributionsListFragment.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import com.google.android.material.floatingactionbutton.FloatingActionButton;
2222

2323
import java.util.ArrayList;
24-
import java.util.Collections;
2524
import java.util.List;
2625

2726
import javax.inject.Inject;

app/src/main/java/fr/free/nrw/commons/upload/UploadService.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import android.net.Uri;
99
import android.os.Bundle;
1010

11-
import android.util.Log;
1211
import androidx.core.app.NotificationCompat;
1312
import androidx.core.app.NotificationManagerCompat;
1413

app/src/main/java/fr/free/nrw/commons/utils/CommonsDateUtil.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ public static SimpleDateFormat getIso8601DateFormatShort() {
2121
return simpleDateFormat;
2222
}
2323

24-
public static SimpleDateFormat getIso8601DateFormatTimestamp() {
24+
/**
25+
* Gets the timestamp for a date
26+
* @return
27+
*/
28+
public static SimpleDateFormat getIso8601DateFormatTimestamp() {
2529
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.ROOT);
2630
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
2731
return simpleDateFormat;

0 commit comments

Comments
 (0)