mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-30 13:12:25 -05:00
Merge pull request #113 from andrewachen/merge
Use a constant for 18 hours.
This commit is contained in:
commit
d4380c0139
@ -186,6 +186,7 @@ public class Utility {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final long MILISECONDS_IN_18_HOURS = 18 * 60 * 60 * 1000;
|
||||||
/**
|
/**
|
||||||
* Returns true if the specified date is within 18 hours of "now". Returns false otherwise.
|
* Returns true if the specified date is within 18 hours of "now". Returns false otherwise.
|
||||||
* @param date
|
* @param date
|
||||||
@ -193,7 +194,7 @@ public class Utility {
|
|||||||
*/
|
*/
|
||||||
public static boolean isDateToday(Date date) {
|
public static boolean isDateToday(Date date) {
|
||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
if (now.getTime() - 64800000 > date.getTime() || now.getTime() + 64800000 < date.getTime()) {
|
if (now.getTime() - MILISECONDS_IN_18_HOURS > date.getTime() || now.getTime() + MILISECONDS_IN_18_HOURS < date.getTime()) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user