- Details
- Written by: Tech Programmer
- Category: Jetpack Compose
- Hits: 1684
Recently, I started working on a new Android project using Jetpack compose. I wanted to have two datetime field to capture start datetime and end datetime using the inbuilt pickers. The date and time selected from the picker should populate single text field with date and time together or two separate text fields representing the date and time respectively.
Much to my surprise there are no datetime picker composable as of now. Furthermore, I realized that DatePickerDialog and DatePicker exists but managing populating the text field with DatePicker state needs to be done by custom code. Finally, for time, TimePicker exists but there is no out of the box TimePickerDialog as of now. In the post, I am sharing the custom datetime composable that I created to accomplish my requirements.
Read more: Custom datetime picker composable with jetpack compose