修复百度定位不准确,添加六分钟卸货限制,gradle优化
This commit is contained in:
@@ -179,6 +179,7 @@ public final class TimeUtil {
|
||||
private static final DateFormat DEFAULT_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
|
||||
private static final DateFormat DEFAULT_FORMAT2 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZSS:SS", Locale.getDefault());
|
||||
private static final DateFormat DEFAULT_FORMAT3 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.getDefault());
|
||||
public static final DateFormat DEFAULT_FORMAT4 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.getDefault());
|
||||
|
||||
private TimeUtil() {
|
||||
throw new UnsupportedOperationException("u can't instantiate me...");
|
||||
@@ -215,7 +216,7 @@ public final class TimeUtil {
|
||||
* @return 毫秒时间戳
|
||||
*/
|
||||
public static long string2Millis(final String time) {
|
||||
if (TextUtils.isEmpty(time)){
|
||||
if (TextUtils.isEmpty(time)) {
|
||||
return -1;
|
||||
}
|
||||
return string2Millis(time, DEFAULT_FORMAT);
|
||||
@@ -242,10 +243,10 @@ public final class TimeUtil {
|
||||
* 将时间字符串转为时间戳
|
||||
* <p>time格式为format</p>
|
||||
*
|
||||
* @param time 时间字符串
|
||||
* @param time 时间字符串
|
||||
* @return 毫秒时间戳
|
||||
*/
|
||||
public static String string2String(final String time,final SimpleDateFormat format) {
|
||||
public static String string2String(final String time, final SimpleDateFormat format) {
|
||||
try {
|
||||
return date2String(format.parse(time));
|
||||
// return DEFAULT_FORMAT.format(DEFAULT_FORMAT2.parse(time).getTime());
|
||||
@@ -421,7 +422,7 @@ public final class TimeUtil {
|
||||
* @return 合适型两个时间差
|
||||
*/
|
||||
public static String getFitTimeSpan(final String time0, final String time1, final int precision) {
|
||||
if (TextUtils.isEmpty(time0)||TextUtils.isEmpty(time1)){
|
||||
if (TextUtils.isEmpty(time0) || TextUtils.isEmpty(time1)) {
|
||||
return "";
|
||||
}
|
||||
return millis2FitTimeSpan(Math.abs(string2Millis(time0, DEFAULT_FORMAT) - string2Millis(time1, DEFAULT_FORMAT)), precision);
|
||||
@@ -1685,7 +1686,7 @@ public final class TimeUtil {
|
||||
* @param compareDate
|
||||
* @return
|
||||
*/
|
||||
public static boolean compareDate(String nowDate, String compareDate,DateFormat format) {
|
||||
public static boolean compareDate(String nowDate, String compareDate, DateFormat format) {
|
||||
DateFormat df = format;
|
||||
try {
|
||||
Date now = df.parse(nowDate);
|
||||
@@ -1700,4 +1701,22 @@ public final class TimeUtil {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 得到二个日期间的间隔天数
|
||||
*
|
||||
* @return 间格的天数(null表示时间格式不正确)
|
||||
*/
|
||||
public static int compareNowDate(long comTime) {
|
||||
int min;
|
||||
try {
|
||||
min = (int) ((getNowMills() - comTime) / (60 * 1000));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return 0;
|
||||
}
|
||||
|
||||
return min;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user