Please help me know, why the output of this is always the else part, even if the first condition gets satisfied

```
  def date_string(date)
    case date
    when date.to_date == Date.today
      "Today"
    when date.to_date == (Date.today - 1.day)
      "Yesterday"
    else
      date.strftime("%dth %B %Y")
    end
  end

```

What am I missing?