@@ -29,7 +29,7 @@ public class Contribution extends Media {
29
29
private static final String TEMPLATE_DATE_ACC_TO_EXIF = "{{According to EXIF data|%s}}" ;
30
30
31
31
//{{date|2009|1|9}} → 9 January 2009
32
- private static final String TEMPLATE_DATA_OTHER_SOURCE = "{{date|%d|%d|%d }}" ;
32
+ private static final String TEMPLATE_DATA_OTHER_SOURCE = "{{date|%s }}" ;
33
33
34
34
public static Creator <Contribution > CREATOR = new Creator <Contribution >() {
35
35
@ Override
@@ -201,16 +201,11 @@ public String getPageContents(Context applicationContext) {
201
201
*/
202
202
private String getTemplatizedCreatedDate () {
203
203
if (dateCreated != null ) {
204
+ java .text .SimpleDateFormat dateFormat = new java .text .SimpleDateFormat ("yyyy-MM-dd" );
204
205
if (UploadableFile .DateTimeWithSource .EXIF_SOURCE .equals (dateCreatedSource )) {
205
- return String .format (Locale .ENGLISH , TEMPLATE_DATE_ACC_TO_EXIF , DateUtil . getDateStringWithSkeletonPattern (dateCreated , "yyyy-MM-dd" )) + "\n " ;
206
+ return String .format (Locale .ENGLISH , TEMPLATE_DATE_ACC_TO_EXIF , dateFormat . format (dateCreated )) + "\n " ;
206
207
} else {
207
- Calendar calendar = Calendar .getInstance ();
208
- calendar .setTime (dateCreated );
209
- calendar .setTimeZone (TimeZone .getTimeZone ("UTC" ));
210
- return String .format (Locale .ENGLISH , TEMPLATE_DATA_OTHER_SOURCE ,
211
- calendar .get (Calendar .YEAR ),
212
- calendar .get (Calendar .MONTH ),
213
- calendar .get (Calendar .DAY_OF_MONTH )) + "\n " ;
208
+ return String .format (Locale .ENGLISH , TEMPLATE_DATA_OTHER_SOURCE , dateFormat .format (dateCreated )) + "\n " ;
214
209
}
215
210
}
216
211
return "" ;
0 commit comments