Use local time for rollups

This commit is contained in:
Jose Farias
2024-10-12 23:03:27 -06:00
parent 6b477a2742
commit 2c6c821e20
2 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -20,7 +20,7 @@ class Bubble::Thread::Rollup
private
attr_reader :thread, :entries, :first_position
delegate :time_ago_in_words, to: "ApplicationController.helpers", private: true
delegate :local_time_ago, to: "ApplicationController.helpers", private: true
def first_position?
first_position
@@ -47,10 +47,10 @@ class Bubble::Thread::Rollup
def summarize(entry, chunk_size)
case entry.action
when "created"
"added by #{entry.creator.name} #{time_ago_in_words(entry.created_at)} ago"
"added by #{entry.creator.name} #{local_time_ago(entry.created_at)}"
when "assigned"
summary = "assigned to #{entry.assignee_names.to_sentence}"
summary += " #{time_ago_in_words(entry.created_at)} ago" unless first_position?
summary += " #{local_time_ago(entry.created_at)}" unless first_position?
summary
when "boosted"
"#{entry.creator.name} +#{chunk_size}"
+2 -2
View File
@@ -1,3 +1,3 @@
<div class="comment--upvotes flex-inline flex-wrap align-start gap fill-white border-radius center position-relative">
<%= rollup.body %>
<div class="comment--upvotes flex-inline flex-wrap align-start fill-white border-radius center position-relative">
<%= rollup.body.html_safe %>
</div>