You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
There is a crash (runtime error DateTimeException) when you use material3.DatePicker in DisplayMode.Input and enter incorrect date like 50/50/2024. Only reproduces in Web, all other targets work correctly.
Affected platforms
Web (K/Wasm) - Canvas based API
Web (K/JS) - Canvas based API
Versions
Libraries:
Compose Multiplatform version: 1.6.1, 1.6.10
Kotlin version: 1.9.23, 2.0.0
To Reproduce
Steps to reproduce the behavior:
Run this code snippet:
@Composable
funBugReproduction() {
Column(Modifier.fillMaxWidth(), horizontalAlignment =Alignment.CenterHorizontally) {
val state = rememberDatePickerState(initialDisplayMode =DisplayMode.Input)
DatePicker(state = state)
}
}
Enter 50/50/2024 date
See error
Expected behavior
There should be no crash but the error tip like "Date does not match expected pattern" like on all other platforms
Screenshots
Web crash:
Desktop ok:
The text was updated successfully, but these errors were encountered:
- Update kotlinx.datetime to
[0.6.0](https://github.com/Kotlin/kotlinx-datetime/releases/tag/v0.6.0)
- Migrate locale-invariant web formatting/parsing to kotlinx.datetime
- Catch parsing exceptions
<!-- Optional -->
FixesJetBrains/compose-multiplatform#4856
## Testing
`KotlinxDatetimeCalendarModelTest.illegalDateParsingDoesNotThrowException`
<!-- Optional -->
This should be tested by QA
## Release Notes
### Fixes - Web
- Fixed crash when date picker text field receives illegal input
MatkovIvan
pushed a commit
to JetBrains/compose-multiplatform-core
that referenced
this issue
May 29, 2024
- Update kotlinx.datetime to
[0.6.0](https://github.com/Kotlin/kotlinx-datetime/releases/tag/v0.6.0)
- Migrate locale-invariant web formatting/parsing to kotlinx.datetime
- Catch parsing exceptions
<!-- Optional -->
FixesJetBrains/compose-multiplatform#4856
## Testing
`KotlinxDatetimeCalendarModelTest.illegalDateParsingDoesNotThrowException`
<!-- Optional -->
This should be tested by QA
## Release Notes
### Fixes - Web
- Fixed crash when date picker text field receives illegal input
Describe the bug
There is a crash (runtime error DateTimeException) when you use
material3.DatePicker
inDisplayMode.Input
and enter incorrect date like50/50/2024
. Only reproduces in Web, all other targets work correctly.Affected platforms
Versions
To Reproduce
Steps to reproduce the behavior:
Expected behavior
There should be no crash but the error tip like "Date does not match expected pattern" like on all other platforms
Screenshots
Web crash:
Desktop ok:
The text was updated successfully, but these errors were encountered: