This is the class
data class Crime(
val id:UUID=UUID.randomUUID(),
var title:String="",
var date: Date= Date(),
var isSolved:Boolean=false)
I want to display current date as a text in button.(Below is the layout for button)
<Button
android:id="@+id/crime_date"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:text="Wed Nov 14 11:56 EST 2018"/>
This is the .kt code to set the text in button
crime_date?.apply {
text = crime.date.toString()
isEnabled = false
}