1
0
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:
Andrew Chen 2012-01-05 19:04:46 -08:00
commit d4380c0139

View File

@ -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.
* @param date
@ -193,7 +194,7 @@ public class Utility {
*/
public static boolean isDateToday(Date 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;
} else {
return true;