feat: Improve the rendering of CSV exports (#8914)

Improve the rendering of the datestamp
This commit is contained in:
Pranav Raj S
2024-02-12 20:01:58 -08:00
committed by GitHub
parent 33a6ad9f7e
commit c607f09be0
9 changed files with 139 additions and 19 deletions

View File

@@ -45,12 +45,8 @@ module Api::V2::Accounts::ReportsHelper
def generate_readable_report_metrics(report_metric)
[
report_metric[:conversations_count],
time_to_minutes(report_metric[:avg_first_response_time]),
time_to_minutes(report_metric[:avg_resolution_time])
Reports::TimeFormatPresenter.new(report_metric[:avg_first_response_time]).format,
Reports::TimeFormatPresenter.new(report_metric[:avg_resolution_time]).format
]
end
def time_to_minutes(time_in_seconds)
(time_in_seconds / 60).to_i
end
end