@@ -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
@@ -210,16 +210,11 @@ public String getPageContents(Context applicationContext) {
210
210
*/
211
211
private String getTemplatizedCreatedDate () {
212
212
if (dateCreated != null ) {
213
+ java .text .SimpleDateFormat dateFormat = new java .text .SimpleDateFormat ("yyyy-MM-dd" );
213
214
if (UploadableFile .DateTimeWithSource .EXIF_SOURCE .equals (dateCreatedSource )) {
214
- return String .format (Locale .ENGLISH , TEMPLATE_DATE_ACC_TO_EXIF , DateUtil . getDateStringWithSkeletonPattern (dateCreated , "yyyy-MM-dd" )) + "\n " ;
215
+ return String .format (Locale .ENGLISH , TEMPLATE_DATE_ACC_TO_EXIF , dateFormat . format (dateCreated )) + "\n " ;
215
216
} else {
216
- Calendar calendar = Calendar .getInstance ();
217
- calendar .setTime (dateCreated );
218
- calendar .setTimeZone (TimeZone .getTimeZone ("UTC" ));
219
- return String .format (Locale .ENGLISH , TEMPLATE_DATA_OTHER_SOURCE ,
220
- calendar .get (Calendar .YEAR ),
221
- calendar .get (Calendar .MONTH ),
222
- calendar .get (Calendar .DAY_OF_MONTH )) + "\n " ;
217
+ return String .format (Locale .ENGLISH , TEMPLATE_DATA_OTHER_SOURCE , dateFormat .format (dateCreated )) + "\n " ;
223
218
}
224
219
}
225
220
return "" ;
0 commit comments