这是一个小烦恼,我找不到任何东西。
我在 Appointment 对象上有一个集合选择,它显示了可用约会的时间:
f.collection_select :appointment_id, @available, :id, :time, {:prompt => "Select a time"}
这使用标准 DateTime 格式显示:2011-10-31 08:00:00 UTC 但我真的更喜欢短格式,如下所示:
appointment.time.to_s(:short)
显示为 10 月 31 日 08:00
使用符号时,我似乎找不到语法。有人知道这个吗?