Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix typo news date format with distance_of_time_in_words
When a blog is configured with the distance_of_time_in_words date_format, the typo news feed on the dashboard crashes because new_js_distance_of_time_in_words_to_now assumes a Time object that responds to #utc. But the _typo_dev.html.erb partial passes a date object, which does not respond to #utc. It would make sense to format just the date, but then we'd need to update the translations to handle the date-only format. Or perhaps we'd could call show_dates_as_local_time() on the page, which uses the browser's locale's date format and makes the server-rendered date mostly irrelevant. For now, fix the crash by converting the parameter to_time before formatting it.
- Loading branch information