Skip to content

Commit

Permalink
Fix Utils.getDate(Context, long, String) missing a format arg (#1674)
Browse files Browse the repository at this point in the history
Fix Utils.getDate(Context, long, String) missing a format arg
  • Loading branch information
EmmanuelMess authored Sep 1, 2019
2 parents af76539 + a58c5c9 commit 6f53c94
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ public void onBindViewHolder(final CompressedItemViewHolder holder, int position

final StringBuilder stringBuilder = new StringBuilder(rowItem.name);
if (compressedExplorerFragment.showLastModified)
holder.date.setText(Utils.getDate(context, rowItem.date, compressedExplorerFragment.year));
holder.date.setText(Utils.getDate(context, rowItem.date));
if (rowItem.directory) {
holder.genericIcon.setImageDrawable(folder);
gradientDrawable.setColor(compressedExplorerFragment.iconskin);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public LayoutElementParcelable(@NonNull Context c, boolean isBack, String title,
this.isDirectory = isDirectory;
if (!date.trim().equals("")) {
this.date = Long.parseLong(date);
this.date1 = Utils.getDate(c, this.date, CURRENT_YEAR);
this.date1 = Utils.getDate(c, this.date);
} else {
this.date = 0;
this.date1 = "";
Expand Down
13 changes: 2 additions & 11 deletions app/src/main/java/com/amaze/filemanager/utils/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class Utils {
private static final String INPUT_INTENT_BLACKLIST_PIPE = "\\|";
private static final String INPUT_INTENT_BLACKLIST_AMP = "&&";
private static final String INPUT_INTENT_BLACKLIST_DOTS = "\\.\\.\\.";
private static final String DATE_TIME_FORMAT = "%s | %s %s";
private static final String DATE_TIME_FORMAT = "%s | %s";

//methods for fastscroller
public static float clamp(float min, float max, float value) {
Expand Down Expand Up @@ -73,16 +73,7 @@ public static void setTint(Context context, CheckBox box, int color) {
}

public static String getDate(@NonNull Context c, long f) {
return String.format(DATE_TIME_FORMAT,
DateUtils.formatDateTime(c, f, DateUtils.FORMAT_SHOW_DATE),
DateUtils.formatDateTime(c, f, DateUtils.FORMAT_SHOW_TIME));
}

public static String getDate(@NonNull Context c, long f, @NonNull String year) {
return String.format(DATE_TIME_FORMAT,
DateUtils.formatDateTime(c, f, DateUtils.FORMAT_SHOW_DATE),
DateUtils.formatDateTime(c, f, DateUtils.FORMAT_SHOW_TIME),
year);
return String.format(DATE_TIME_FORMAT, DateUtils.formatDateTime(c, f, DateUtils.FORMAT_SHOW_DATE), DateUtils.formatDateTime(c, f, DateUtils.FORMAT_SHOW_TIME));
}

/**
Expand Down

0 comments on commit 6f53c94

Please sign in to comment.