Show datetime with seconds in the Points page.

This commit is contained in:
Eugene Burmakin 2025-05-02 20:43:53 +02:00
parent 5ac61fa848
commit 72927379b7
3 changed files with 16 additions and 1 deletions

View file

@ -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.

View file

@ -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

View file

@ -14,7 +14,7 @@
%>
</td>
<td class='<%= speed_text_color(point.velocity) %>'><%= point.velocity %></td>
<td><%= human_datetime(point.recorded_at) %></td>
<td><%= human_datetime_with_seconds(point.recorded_at) %></td>
<td><%= point.lat %>, <%= point.lon %></td>
<td></td>
</tr>