Skip to content

Commit

Permalink
Use the correct date formatter in the subtitle
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmir committed Nov 28, 2024
1 parent e3f20c7 commit d5aa2b9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,6 @@ module RecurringMeetings
class TableComponent < ::OpPrimer::BorderBoxTableComponent
columns :start_time, :relative_time, :last_edited, :status, :create

# def sortable?
# true
# end
#
# def initial_sort
# %i[start_time asc]
# end

def has_actions?
true
end
Expand Down
35 changes: 18 additions & 17 deletions modules/meeting/app/models/recurring_meeting.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,23 +70,24 @@ def schedule

def schedule_in_words # rubocop:disable Metrics/AbcSize
base = case frequency
when "daily"
interval == 1 ? human_frequency : I18n.t("recurring_meeting.in_words.daily_interval", interval: interval.ordinalize)
when "working_days"
if interval == 1
I18n.t("recurring_meeting.in_words.working_days")
else
I18n.t("recurring_meeting.in_words.working_days_interval", interval: interval.ordinalize)
end
when "weekly"
if interval == 1
I18n.t("recurring_meeting.in_words.weekly", weekday:)
else
I18n.t("recurring_meeting.in_words.weekly_interval", interval: interval.ordinalize, weekday:)
end
end

I18n.t("recurring_meeting.in_words.full", base:, time: format_time(start_time, include_date: false), end_date:)
when "daily"
interval == 1 ? human_frequency : I18n.t("recurring_meeting.in_words.daily_interval", interval: interval.ordinalize)
when "working_days"
if interval == 1
I18n.t("recurring_meeting.in_words.working_days")
else
I18n.t("recurring_meeting.in_words.working_days_interval", interval: interval.ordinalize)
end
when "weekly"
if interval == 1
I18n.t("recurring_meeting.in_words.weekly", weekday:)
else
I18n.t("recurring_meeting.in_words.weekly_interval", interval: interval.ordinalize, weekday:)
end
end

I18n.t("recurring_meeting.in_words.full", base:, time: format_time(start_time, include_date: false),
end_date: format_date(end_date))
end

def scheduled_occurrences(limit:)
Expand Down

0 comments on commit d5aa2b9

Please sign in to comment.