mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-25 17:51:36 +01:00
Use more accurate beginning/ending times in annual report source (#31751)
This commit is contained in:
parent
ef2bc8ea26
commit
fe04291af4
1 changed files with 11 additions and 1 deletions
|
@ -11,6 +11,16 @@ class AnnualReport::Source
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def year_as_snowflake_range
|
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
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue