Skip to content

Commit

Permalink
fix: hide meetups past 10am on the day
Browse files Browse the repository at this point in the history
  • Loading branch information
th0rgall committed Jun 18, 2024
1 parent ed1eecd commit 418bc9f
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions src/lib/components/Map/MeetupLayer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,21 @@
};
const meetupFeatureCollection: (_: any) => GeoJSON.FeatureCollection = () => ({
type: 'FeatureCollection',
features: meetups.map((m) => ({
type: 'Feature',
properties: {
...m,
// For easier serialization, arrays are serialized as strings.
icon: selectedMeetupId === m.id ? 'fireplace-selected' : 'fireplace'
},
geometry: {
type: 'Point',
coordinates: m.lnglat
}
}))
features: meetups
// hide meetups, margin of 10 hours
.filter(({ date }) => new Date().getTime() < date.getTime() + 1000 * 3600 * 10)
.map((m) => ({
type: 'Feature',
properties: {
...m,
// For easier serialization, arrays are serialized as strings.
icon: selectedMeetupId === m.id ? 'fireplace-selected' : 'fireplace'
},
geometry: {
type: 'Point',
coordinates: m.lnglat
}
}))
});
async function loadLayer() {
Expand Down

0 comments on commit 418bc9f

Please sign in to comment.