mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-23 04:02:07 +01:00
Fix before:
, after:
and during:
failing when time zone not set (#26782)
This commit is contained in:
parent
173041f02c
commit
e52d0494ee
1 changed files with 3 additions and 3 deletions
|
@ -95,15 +95,15 @@ class SearchQueryTransformer < Parslet::Transform
|
|||
when 'before'
|
||||
@filter = :created_at
|
||||
@type = :range
|
||||
@term = { lt: term, time_zone: @options[:current_account]&.user_time_zone || 'UTC' }
|
||||
@term = { lt: term, time_zone: @options[:current_account]&.user_time_zone.presence || 'UTC' }
|
||||
when 'after'
|
||||
@filter = :created_at
|
||||
@type = :range
|
||||
@term = { gt: term, time_zone: @options[:current_account]&.user_time_zone || 'UTC' }
|
||||
@term = { gt: term, time_zone: @options[:current_account]&.user_time_zone.presence || 'UTC' }
|
||||
when 'during'
|
||||
@filter = :created_at
|
||||
@type = :range
|
||||
@term = { gte: term, lte: term, time_zone: @options[:current_account]&.user_time_zone || 'UTC' }
|
||||
@term = { gte: term, lte: term, time_zone: @options[:current_account]&.user_time_zone.presence || 'UTC' }
|
||||
else
|
||||
raise "Unknown prefix: #{prefix}"
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue