DateUtils: fix time always being reported as new
also change parameter name to reflect expected input
@@ -8,8 +8,8 @@ public class DateUtils {
private DateUtils() {}
- public static boolean isNotLongerAgoThen(@NonNull Date timestamp, int minutes, int seconds) {
- long differenceInMs = timestamp.getTime() - new Date().getTime();
+ public static boolean isNotLongerAgoThen(@NonNull Date date, int minutes, int seconds) {
+ long differenceInMs = new Date().getTime() - date.getTime();
return differenceInMs <= (minutes * 60 + seconds) * 1000;
}
}
