0

When implementing Datepicker in kotlin instead of August its showing M08 in all devices.

https://i.stack.imgur.com/BoFbh.png This is the image of what i get and i used this code

 binding.imgSetDate.setOnClickListener {
            val datePickerDialog = DatePickerDialog(
                this,
                DatePickerDialog.OnDateSetListener { view, year, month, dayOfMonth ->
                    calendar.set(Calendar.YEAR, year)
                    calendar.set(Calendar.MONTH, month)
                    calendar.set(Calendar.DAY_OF_MONTH, dayOfMonth)
                    selectedDate = SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()).format(calendar.time)
                    binding.etEventDatenew.setText(selectedDate)
                },
                calendar.get(Calendar.YEAR),
                calendar.get(Calendar.MONTH),
                calendar.get(Calendar.DAY_OF_MONTH)
            )
            datePickerDialog.datePicker.minDate = System.currentTimeMillis() - 1000

            datePickerDialog.show()
        }
  • 1
    Does this answer your question? [Month name is appearing with M+number in datePicker dialog in android](https://stackoverflow.com/questions/39771583/month-name-is-appearing-with-mnumber-in-datepicker-dialog-in-android) – Ivo Aug 23 '23 at 12:49

0 Answers0