Skip to content

Commit 5496d00

Browse files
committed
clean viewExt
1 parent 84dbf1b commit 5496d00

2 files changed

Lines changed: 5 additions & 9 deletions

File tree

app/src/main/java/org/secfirst/umbrella/whitelabel/misc/StringEtx.kt

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,11 @@ val currentTime: String
1818

1919

2020
fun convertDateToString(date: Date?): String {
21-
val dateFormat: DateFormat
21+
var dateFormat: DateFormat
2222
var dateConvert = ""
23-
try {
24-
if (date != null) {
25-
dateFormat = SimpleDateFormat("MM/dd/yyyy HH:mm:ss", Locale.ENGLISH)
26-
dateConvert = dateFormat.format(date)
27-
}
28-
} catch (e: Exception) {
29-
return dateConvert
23+
date?.let {
24+
dateFormat = SimpleDateFormat("MM/dd/yyyy HH:mm:ss", Locale.ENGLISH)
25+
dateConvert = dateFormat.format(date)
3026
}
3127
return dateConvert
3228
}

app/src/main/java/org/secfirst/umbrella/whitelabel/misc/ViewExt.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ fun BottomNavigationView.removeShiftMode() {
7979

8080
const val ITEM_VIEW_TYPE_HEADER = 0
8181
const val ITEM_VIEW_TYPE_ITEM = 1
82-
const val ITEM_VIEW_EMPTY= 2
82+
8383

8484
fun Spinner.init(array: Int) {
8585
ArrayAdapter.createFromResource(

0 commit comments

Comments
 (0)