Fix TransferDetail deserialization error by updating transferDate type to String (#1875)

This commit is contained in:
Hekmatullah 2025-06-28 18:18:02 +01:00 committed by GitHub
parent f8d584beaa
commit 7535f16137
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 23 additions and 2 deletions

View File

@ -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
*

View File

@ -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,

View File

@ -298,6 +298,7 @@ private fun AccountList(
HorizontalPager(
state = pagerState,
pageSpacing = 5.dp,
modifier = modifier,
) {
AccountCard(

View File

@ -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'