0
我想使用助手distance_of_time_in_words,它工作正常,但天數不準確。單詞中的時間距離?
我有我的表:
t.datetime "start"
t.datetime "end"
而且我使用:
<%= distance_of_time_in_words(Time.now, @promotion.end) %>
的事情是,我有促銷明天結束,但在我看來,它仍然說「 4天到結束「...
什麼可能是錯的?
向我們顯示數據。 –
@TheChamp我認爲這是內置的。 –
[distance_of_time_in_words](http://api.rubyonrails.org/classes/ActionView/Helpers/DateHelper.html#method-i-distance_of_time_in_words)幷包括它http://stackoverflow.com/a/9573793/1183537 – SuckerForMayhem