44import android .os .Bundle ;
55import android .support .v4 .app .DialogFragment ;
66import android .support .v7 .app .AlertDialog ;
7+ import android .text .format .DateFormat ;
78import android .view .View ;
89import android .widget .TextView ;
910
1213import com .simplemobiletools .filemanager .models .FileDirItem ;
1314
1415import java .io .File ;
16+ import java .util .Calendar ;
17+ import java .util .Locale ;
1518
1619public class PropertiesDialog extends DialogFragment {
1720 private static FileDirItem mItem ;
@@ -37,7 +40,7 @@ public Dialog onCreateDialog(Bundle savedInstanceState) {
3740 ((TextView ) infoView .findViewById (R .id .properties_size )).setText (getItemSize ());
3841
3942 final File file = new File (mItem .getPath ());
40- ((TextView ) infoView .findViewById (R .id .properties_last_modified )).setText (String . valueOf (file .lastModified ()));
43+ ((TextView ) infoView .findViewById (R .id .properties_last_modified )).setText (formatLastModified (file .lastModified ()));
4144
4245 final AlertDialog .Builder builder = new AlertDialog .Builder (getContext ());
4346 builder .setTitle (getResources ().getString (title ));
@@ -55,6 +58,12 @@ private String getItemSize() {
5558 return Utils .getFormattedSize (mItem );
5659 }
5760
61+ private String formatLastModified (long ts ) {
62+ Calendar cal = Calendar .getInstance (Locale .ENGLISH );
63+ cal .setTimeInMillis (ts );
64+ return DateFormat .format ("dd/MM/yyyy HH:mm" , cal ).toString ();
65+ }
66+
5867 private long directorySize (File dir ) {
5968 if (dir .exists ()) {
6069 long size = 0 ;
0 commit comments