Challenge Formatting the Date

In the Crime Data Class how would I cast the Data to a DateFormat Object and then use that object in the Fragment? I am using

    fun bind(crime: Crime) {
        this.crime = crime
        titleTextView.text = this.crime.title
//            Chapter 10 Challenge: Formatting the Date
            dateTextView.text = this.crime.date.getLongDateFormat()
            solvedImageView.visibility = if (crime.isSolved) {
                View.VISIBLE
            } else {
                View.GONE
            }
        }

And Note having any luck

@Gawitt try the following

dateTextView.text = DateFormat.format("EEEE, MMM dd, yyyy.", this.crime.date)

You call the static format method of the Date Format class specifically the version that takes 2 parameters:

1.) A CharSequence (i.e. the custom date format you want for example if you don’t send a greetings card to you mother on mother’s day and you want to report that crime the custom date format would be “Sunday, May 10, 2020.” so your character sequence is “EEEE, MMM dd, yyyy.” accordingly :sunglasses: !

2.) A Date object i.e. the date for the crime.

Don’t hesitate to look at the android developer docs thats how you get through most of the challenges and learn more stuff. Hope this helps.