From 6ffe43693bc4c0f68c2434b2f7909f5b114f560c Mon Sep 17 00:00:00 2001 From: Daniel Nitsikopoulos Date: Sun, 15 Oct 2023 17:28:00 +1100 Subject: [PATCH] Fix timezones for top_track calculation --- app/queries/posts/top_tracks.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/queries/posts/top_tracks.rb b/app/queries/posts/top_tracks.rb index 5817eca..4695577 100644 --- a/app/queries/posts/top_tracks.rb +++ b/app/queries/posts/top_tracks.rb @@ -9,8 +9,8 @@ module Adamantium def call(slug:) post = post_repo.fetch!(slug) - start_date = TimeMath.week.floor(post.published_at).to_i - end_date = TimeMath.week.ceil(post.published_at).to_i + start_date = TimeMath.week.floor(post.published_at) + end_date = TimeMath.week.ceil(post.published_at) top_tracks = top_track_repo.for_post(id: post.id)