Hello, I am a newbie in crystal.
I have a trouble to format time to string in render,
I select the time field from db, we can say it work_started_at
,
and it should be (Time | Nil)
then when I type
work_started_at.to_s("%Y-%m-%d")
The compiler said the error:
no overload matches ‘Nil#to_s’ with type String
Overloads are:
- Nil#to_s(io : IO)
- Nil#to_s()
- Object#to_s(io : IO)
- Object#to_s()
How should I do with it?