4 ms·
You could use a better string interpolation tool that replaces, “0 days ago” with “today”.
by hinkley 1y ago
You could use a better string interpolation tool that replaces, “0 days ago” with “today”.
- jaggederest 1y agoActiveSupport still has a wonderfully readable implementation: https://github.com/rails/rails/blob/b0c813bc7b61c71dd21ee3a6c6210f6d14030f71/actionview/lib/action_view/helpers/date_helper.rb#L95-L158 https://github.com/rails/rails/blob/b0c813bc7b61c71dd21ee3a6... Though I don't really use Rails that often any more, I still miss some of the niceties.
- ralferoo 1y agoIf something was less than 24 hours ago, there's a good chance that it was actually be "yesterday" rather than "today". The peer post linking to someone else's solution that uses size appropriate scales seems better.