diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 3fe89204..5495369b 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -110,4 +110,14 @@ module ApplicationHelper def human_date(date) date.strftime('%e %B %Y') end + + def immich_search_url(base_url, start_date, end_date) + query = { + takenAfter: "#{start_date.to_date}T00:00:00.000Z", + takenBefore: "#{end_date.to_date}T23:59:59.999Z" + } + + encoded_query = URI.encode_www_form_component(query.to_json) + "#{base_url}/search?query=#{encoded_query}" + end end diff --git a/app/views/trips/show.html.erb b/app/views/trips/show.html.erb index 07f2f1e4..76a3a453 100644 --- a/app/views/trips/show.html.erb +++ b/app/views/trips/show.html.erb @@ -65,7 +65,7 @@ <% end %>