mirror of
https://github.com/openMF/mobile-wallet.git
synced 2026-02-06 11:07:02 +00:00
Fix TransferDetail deserialization error by updating transferDate type to String (#1875)
This commit is contained in:
parent
f8d584beaa
commit
7535f16137
@ -68,6 +68,26 @@ object DateHelper {
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses a date string with an auto-detected delimiter and returns it in "dd MMM yyyy" format.
|
||||
*
|
||||
* @param dateString The input date string, e.g., "2016-04-14", "2016/04/14", "2016.04.14"
|
||||
* @return A formatted date string like "14 Apr 2016"
|
||||
*/
|
||||
fun getDateAsString(dateString: String): String {
|
||||
val delimiters = listOf("-", "/", ".")
|
||||
val detectedDelimiter = delimiters.find { dateString.contains(it) }
|
||||
?: throw IllegalArgumentException("Unsupported date format: no recognized delimiter found.")
|
||||
|
||||
val dateComponents = dateString.split(detectedDelimiter).mapNotNull { it.toIntOrNull() }
|
||||
if (dateComponents.size != 3) {
|
||||
throw IllegalArgumentException("Invalid date format: expected format like yyyy-MM-dd.")
|
||||
}
|
||||
|
||||
val (year, month, day) = dateComponents
|
||||
return "$day ${getMonthName(month)} $year"
|
||||
}
|
||||
|
||||
/**
|
||||
* This Method converting the dd-MM-yyyy format type date string into dd MMMM yyyy
|
||||
*
|
||||
|
||||
@ -17,7 +17,7 @@ data class TransferDetail(
|
||||
val reversed: Boolean = false,
|
||||
val currency: Currency = Currency(),
|
||||
val transferAmount: Double = 0.0,
|
||||
val transferDate: List<Int>,
|
||||
val transferDate: String = "",
|
||||
val transferDescription: String? = null,
|
||||
val fromOffice: FromOffice,
|
||||
val fromClient: FromClient,
|
||||
|
||||
@ -298,6 +298,7 @@ private fun AccountList(
|
||||
|
||||
HorizontalPager(
|
||||
state = pagerState,
|
||||
pageSpacing = 5.dp,
|
||||
modifier = modifier,
|
||||
) {
|
||||
AccountCard(
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package: name='org.mifospay' versionCode='1' versionName='2025.6.5-beta.0.1' platformBuildVersionName='15' platformBuildVersionCode='35' compileSdkVersion='35' compileSdkVersionCodename='15'
|
||||
package: name='org.mifospay' versionCode='1' versionName='2025.6.5-beta.0.2' platformBuildVersionName='15' platformBuildVersionCode='35' compileSdkVersion='35' compileSdkVersionCodename='15'
|
||||
sdkVersion:'26'
|
||||
targetSdkVersion:'34'
|
||||
uses-permission: name='android.permission.INTERNET'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user