From 72927379b7fe528c19336237d395303a61d35e1a Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Fri, 2 May 2025 20:43:53 +0200 Subject: [PATCH] Show datetime with seconds in the Points page. --- CHANGELOG.md | 4 ++++ app/helpers/application_helper.rb | 11 +++++++++++ app/views/points/_point.html.erb | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ccf91e8..cecde488 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Vector maps are supported in non-self-hosted mode. - Credentials for Sidekiq UI are now being set via environment variables: `SIDEKIQ_USERNAME` and `SIDEKIQ_PASSWORD`. Default credentials are `sidekiq` and `password`. +## Changed + +- Datetime is now being displayed with seconds in the Points page. #1088 + ## Removed - Sample points are no longer being imported automatically for new users. diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index c66e3262..5b9b71e3 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -126,6 +126,17 @@ module ApplicationHelper ) end + def human_datetime_with_seconds(datetime) + return unless datetime + + content_tag( + :span, + datetime.strftime('%e %b %Y, %H:%M:%S'), + class: 'tooltip', + data: { tip: datetime.iso8601 } + ) + end + def speed_text_color(speed) return 'text-default' if speed.to_i >= 0 diff --git a/app/views/points/_point.html.erb b/app/views/points/_point.html.erb index 6c0c238b..30b9a861 100644 --- a/app/views/points/_point.html.erb +++ b/app/views/points/_point.html.erb @@ -14,7 +14,7 @@ %> <%= point.velocity %> - <%= human_datetime(point.recorded_at) %> + <%= human_datetime_with_seconds(point.recorded_at) %> <%= point.lat %>, <%= point.lon %>