Update timestamps

This commit is contained in:
Eugene Burmakin 2025-04-04 20:15:05 +02:00
parent 0ed6fb7ea8
commit 4fcfdc7bd7
11 changed files with 29 additions and 12 deletions

View file

@ -71,3 +71,4 @@ volumes:
dawarich_shared: dawarich_shared:
dawarich_public: dawarich_public:
dawarich_watched: dawarich_watched:
dawarich_storage:

View file

@ -67,6 +67,7 @@ If your hardware doesn't have enough memory to migrate the imports, you can dele
- `rake points:migrate_to_lonlat` task now also reindexes the points table. - `rake points:migrate_to_lonlat` task now also reindexes the points table.
- Fixed filling `lonlat` column for old places after reverse geocoding. - Fixed filling `lonlat` column for old places after reverse geocoding.
- Deleting an import now correctly recalculates stats. - Deleting an import now correctly recalculates stats.
- Datetime across the app is now being displayed in human readable format, i.e 26 Dec 2024, 13:49. Hover over the datetime to see the ISO 8601 timestamp.
# 0.25.3 - 2025-03-22 # 0.25.3 - 2025-03-22

View file

@ -115,6 +115,17 @@ module ApplicationHelper
date.strftime('%e %B %Y') date.strftime('%e %B %Y')
end end
def human_datetime(datetime)
return unless datetime
content_tag(
:span,
datetime.strftime('%e %b %Y, %H:%M'),
class: 'tooltip',
data: { tip: datetime.iso8601 }
)
end
def speed_text_color(speed) def speed_text_color(speed)
return 'text-default' if speed.to_i >= 0 return 'text-default' if speed.to_i >= 0

View file

@ -37,7 +37,7 @@
<% @exports.each do |export| %> <% @exports.each do |export| %>
<tr> <tr>
<td><%= export.name %></td> <td><%= export.name %></td>
<td><%= export.created_at.strftime('%Y-%m-%d %H:%M:%S') %></td> <td><%= human_datetime(export.created_at) %></td>
<td><%= export.status %></td> <td><%= export.status %></td>
<td> <td>
<% if export.completed? %> <% if export.completed? %>

View file

@ -15,7 +15,7 @@
<td> <td>
<%= "#{number_with_delimiter import.points.size}" %> <%= "#{number_with_delimiter import.points.size}" %>
</td> </td>
<td><%= import.created_at.strftime("%d.%m.%Y, %H:%M") %></td> <td><%= human_datetime(import.created_at) %></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View file

@ -68,12 +68,17 @@
<td data-reverse-geocoded-points-count> <td data-reverse-geocoded-points-count>
<%= number_with_delimiter import.reverse_geocoded_points_count %> <%= number_with_delimiter import.reverse_geocoded_points_count %>
</td> </td>
<td><%= import.created_at.strftime("%d.%m.%Y, %H:%M") %></td> <td><%= human_datetime(import.created_at) %></td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="flex justify-center my-5">
<div class='flex'>
<%= paginate @imports %>
</div>
</div>
<% end %> <% end %>
</div> </div>
</div> </div>

View file

@ -38,7 +38,7 @@
<% @places.each do |place| %> <% @places.each do |place| %>
<tr> <tr>
<td><%= place.name %></td> <td><%= place.name %></td>
<td><%= place.created_at.strftime('%Y-%m-%d %H:%M:%S') %></td> <td><%= human_datetime(place.created_at) %></td>
<td><%= "#{place.lat}, #{place.lon}" %></td> <td><%= "#{place.lat}, #{place.lon}" %></td>
<td> <td>
<%= link_to 'Delete', place, data: { confirm: "Are you sure? Deleting a place will result in deleting all visits for this place.", turbo_confirm: "Are you sure? Deleting a place will result in deleting all visits for this place.", turbo_method: :delete }, method: :delete, class: "px-4 py-2 bg-red-500 text-white rounded-md" %> <%= link_to 'Delete', place, data: { confirm: "Are you sure? Deleting a place will result in deleting all visits for this place.", turbo_confirm: "Are you sure? Deleting a place will result in deleting all visits for this place.", turbo_method: :delete }, method: :delete, class: "px-4 py-2 bg-red-500 text-white rounded-md" %>

View file

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

View file

@ -26,7 +26,7 @@
<%= number_with_delimiter user.tracked_points.count %> <%= number_with_delimiter user.tracked_points.count %>
</td> </td>
<td> <td>
<%= user.created_at.strftime('%Y-%m-%d %H:%M:%S') %> <%= human_datetime(user.created_at) %>
</td> </td>
</tr> </tr>
<% end %> <% end %>

View file

@ -1,4 +1,4 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
require_relative "../config/application" require_relative '../config/application'
require "importmap/commands" require 'importmap/commands'

View file

@ -6,6 +6,7 @@ pin_all_from 'app/javascript/channels', under: 'channels'
pin 'application', preload: true pin 'application', preload: true
pin '@rails/actioncable', to: 'actioncable.esm.js' pin '@rails/actioncable', to: 'actioncable.esm.js'
pin '@rails/activestorage', to: 'activestorage.esm.js'
pin '@hotwired/turbo-rails', to: 'turbo.min.js', preload: true pin '@hotwired/turbo-rails', to: 'turbo.min.js', preload: true
pin '@hotwired/stimulus', to: 'stimulus.min.js', preload: true pin '@hotwired/stimulus', to: 'stimulus.min.js', preload: true
pin '@hotwired/stimulus-loading', to: 'stimulus-loading.js', preload: true pin '@hotwired/stimulus-loading', to: 'stimulus-loading.js', preload: true
@ -17,10 +18,8 @@ pin 'chartkick', to: 'chartkick.js'
pin 'Chart.bundle', to: 'Chart.bundle.js' pin 'Chart.bundle', to: 'Chart.bundle.js'
pin 'leaflet.heat' # @0.2.0 pin 'leaflet.heat' # @0.2.0
pin 'leaflet-draw' # @1.0.4 pin 'leaflet-draw' # @1.0.4
pin '@rails/actioncable', to: 'actioncable.esm.js'
pin_all_from 'app/javascript/channels', under: 'channels'
pin 'notifications_channel', to: 'channels/notifications_channel.js' pin 'notifications_channel', to: 'channels/notifications_channel.js'
pin 'points_channel', to: 'channels/points_channel.js' pin 'points_channel', to: 'channels/points_channel.js'
pin 'imports_channel', to: 'channels/imports_channel.js' pin 'imports_channel', to: 'channels/imports_channel.js'
pin "trix" pin 'trix'
pin "@rails/actiontext", to: "actiontext.esm.js" pin '@rails/actiontext', to: 'actiontext.esm.js'