Skip to content

Commit

Permalink
fix: [ANDROAPP-6628] datePicker onValueChange date format (#333)
Browse files Browse the repository at this point in the history
* fix: [ANDROAPP-6628] datePicker onValueChange date format

* ktlint
  • Loading branch information
mmmateos authored Dec 12, 2024
1 parent 5f62bf6 commit 12034c5
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -677,13 +677,15 @@ fun InputDateTime(
showDatePicker = false
if (uiData.actionType != DateTimeActionType.DATE_TIME) {
datePickerState.selectedDateMillis?.let {
onValueChanged(
manageOnValueChanged(
TextFieldValue(
getDate(it),
selection = TextRange(
state.inputTextFieldValue?.text?.length ?: 0,
),
),
onValueChanged,
uiData.actionType,
)
}
} else {
Expand Down Expand Up @@ -918,7 +920,7 @@ private fun parseStringDateToMillis(dateString: String, pattern: String = "ddMMy
} ?: 0L
}

internal fun getDate(milliSeconds: Long?, format: String? = "ddMMyyyy"): String {
internal fun getDate(milliSeconds: Long?, format: String = "ddMMyyyy"): String {
val cal = Calendar.getInstance()
val currentTimeZone: TimeZone = cal.getTimeZone()
val currentDt: Calendar = GregorianCalendar(currentTimeZone, Locale.getDefault())
Expand Down

0 comments on commit 12034c5

Please sign in to comment.