Skip to content

Commit 9ef7f3f

Browse files
committed
fix: custom map chart interaction for NASA statistics
1 parent dcce8ac commit 9ef7f3f

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

app/src/components/map/Map.vue

+8-6
Original file line numberDiff line numberDiff line change
@@ -802,18 +802,20 @@ export default {
802802
if (timeEntry === undefined && time.isLuxonDateTime) {
803803
// search for closest time to datetime if provided as such
804804
const searchTimes = this.availableTimeEntries.map((e) => {
805-
if (e.value?.isLuxonDateTime) {
806-
return e.value;
805+
const timeValue = Array.isArray(e.value) ? e.value[0] : e.value;
806+
if (timeValue?.isLuxonDateTime) {
807+
return timeValue;
807808
}
808-
return DateTime.fromISO(e.value);
809+
return DateTime.fromISO(timeValue);
809810
});
810811
const closestTime = findClosest(searchTimes, time);
811812
// get back the original unmapped object with value and name
812813
timeEntry = this.availableTimeEntries.find((e) => {
813-
if (e.value?.isLuxonDateTime) {
814-
return e.value.ts === closestTime.ts;
814+
const timeValue = Array.isArray(e.value) ? e.value[0] : e.value;
815+
if (timeValue?.isLuxonDateTime) {
816+
return timeValue.ts === closestTime.ts;
815817
}
816-
return DateTime.fromISO(e.value).ts === closestTime.ts;
818+
return DateTime.fromISO(timeValue).ts === closestTime.ts;
817819
});
818820
} else {
819821
// Use most recent time since there is none defined in the map timeline

0 commit comments

Comments
 (0)