Browse Source

Use more accurate beginning/ending times in annual report source (#31751)

dariusk-working/4_3_0
Matt Jankowski 2 years ago committed by GitHub
parent
commit
fe04291af4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 12
      app/lib/annual_report/source.rb

12
app/lib/annual_report/source.rb

@ -11,6 +11,16 @@ class AnnualReport::Source
protected
def year_as_snowflake_range
(Mastodon::Snowflake.id_at(DateTime.new(year, 1, 1))..Mastodon::Snowflake.id_at(DateTime.new(year, 12, 31)))
(beginning_snowflake_id..ending_snowflake_id)
end
private
def beginning_snowflake_id
Mastodon::Snowflake.id_at DateTime.new(year).beginning_of_year
end
def ending_snowflake_id
Mastodon::Snowflake.id_at DateTime.new(year).end_of_year
end
end

Loading…
Cancel
Save