时间问题修复
This commit is contained in:
@@ -37,8 +37,8 @@ android {
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 29
|
||||
// multiDexEnabled true
|
||||
versionCode 1
|
||||
versionName "1.1.1"
|
||||
versionCode 2
|
||||
versionName "1.1.2"
|
||||
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
|
||||
ndk {
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.1.1","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
<!-- Required 一些系统要求的权限,如访问网络等 -->
|
||||
<!-- <uses-permission android:name="android.permission.READ_CALENDAR" />
|
||||
<uses-permission android:name="android.permission.WRITE_CALENDAR" /-->>
|
||||
<uses-permission android:name="android.permission.WRITE_CALENDAR" /-->
|
||||
<uses-permission android:name="com.nifengkeji.xyq.permission.JPUSH_MESSAGE" />
|
||||
<uses-permission android:name="android.permission.RECEIVE_USER_PRESENT" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
|
||||
@@ -27,17 +27,18 @@ public class TimeUtils {
|
||||
} else if (span < TimeConstants.DAY) {
|
||||
return String.format(Locale.getDefault(), "%d小时前", span / TimeConstants.HOUR);
|
||||
} else if (span < TimeConstants.MONTH) {
|
||||
if (span / TimeConstants.DAY >= 7) {
|
||||
SimpleDateFormat sdr = new SimpleDateFormat("MM-dd",
|
||||
Locale.CHINA);
|
||||
return sdr.format(millis);
|
||||
} else {
|
||||
// if (span / TimeConstants.DAY >= 7) {
|
||||
// SimpleDateFormat sdr = new SimpleDateFormat("MM-dd",
|
||||
// Locale.CHINA);
|
||||
// return sdr.format(millis);
|
||||
// } else {
|
||||
//
|
||||
//
|
||||
// }
|
||||
String format = String.format(Locale.getDefault(), "%d天前", span / TimeConstants.DAY);
|
||||
|
||||
Log.e("format",format);
|
||||
return format;
|
||||
|
||||
}
|
||||
} else if (span < TimeConstants.YEAR) {
|
||||
SimpleDateFormat sdr;
|
||||
if (span / TimeConstants.MONTH >= 6) {
|
||||
|
||||
Reference in New Issue
Block a user