From 5bd6a6c072935d6392e270ff5283b660307f8392 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Fri, 24 Jan 2025 16:37:28 +0100 Subject: [PATCH] Don't trim time from start and end dates --- CHANGELOG.md | 4 ++++ app/javascript/controllers/maps_controller.js | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e66d12ac..95de7bbf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Trips are now store their paths in the database independently of the points. - Trips are now being rendered on the map using their precalculated paths instead of list of coordinates. +### Changed + +- Requesting photos on the Map page now uses the start and end dates from the URL params. #589 + # 0.23.5 - 2025-01-22 ### Added diff --git a/app/javascript/controllers/maps_controller.js b/app/javascript/controllers/maps_controller.js index 313b477d..997821da 100644 --- a/app/javascript/controllers/maps_controller.js +++ b/app/javascript/controllers/maps_controller.js @@ -218,8 +218,8 @@ export default class extends Controller { } const urlParams = new URLSearchParams(window.location.search); - const startDate = urlParams.get('start_at')?.split('T')[0] || new Date().toISOString().split('T')[0]; - const endDate = urlParams.get('end_at')?.split('T')[0] || new Date().toISOString().split('T')[0]; + const startDate = urlParams.get('start_at') || new Date().toISOString(); + const endDate = urlParams.get('end_at')|| new Date().toISOString(); await fetchAndDisplayPhotos({ map: this.map, photoMarkers: this.photoMarkers,