forked from openMF/android-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: refactor client details screen to compose
- Loading branch information
1 parent
1b56478
commit 9af5b0f
Showing
24 changed files
with
1,372 additions
and
787 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
core/common/src/main/java/com/mifos/core/common/utils/Utils.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.mifos.core.common.utils | ||
|
||
import java.text.DateFormat | ||
import java.util.Calendar | ||
import java.util.TimeZone | ||
|
||
object Utils { | ||
|
||
fun getStringOfDate(dateObj: List<Int?>): String { | ||
val calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC")) | ||
dateObj.getOrNull(0)?.let { year -> | ||
calendar.set(Calendar.YEAR, year) | ||
} | ||
dateObj.getOrNull(1)?.let { month -> | ||
calendar.set(Calendar.MONTH, month - 1) | ||
} | ||
dateObj.getOrNull(2)?.let { day -> | ||
calendar.set(Calendar.DAY_OF_MONTH, day) | ||
} | ||
val dateFormat = DateFormat.getDateInstance(DateFormat.MEDIUM) | ||
return dateFormat.format(calendar.time) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.