coreymckrill / nearby-wordpress-events

A widget to show nearby WP events in the Dashboard
GNU General Public License v2.0
11 stars 4 forks source link

Events older than 24 hours are being displayed #18

Open iandunn opened 7 years ago

iandunn commented 7 years ago

Reported by @ntwb on the call-for-feedback post:

Time Zone offsets are required, (I think), I just installed the plugin on my site and it is showing a Meetup that I organised and attended ~26hrs 19mins ago… I’d expect this meetup to not be shown. I’m taking a wild guess here that as I’m in UTC+10 the Meetup API requests are only returned as UTC?

This may be something on the API side, or may require changes there and here.

I think ideally, we'd want to display all events that occurred on the current day (in the user's native timezone), even if they finished a few hours in the past. So, for example, an event that finished at 11am or 7pm, would continue to be displayed until 11:59pm.

ntwb commented 7 years ago

Makes sense 👍

p.s thanks for the ping 😄

dd32 commented 7 years ago

This is probably something that needs to be filtered on the client side.

IIRC the meetup.com API doesn't specify the timezone, so for the initial API we had to store the local time for all events without a timezone, and return any events that would've happened in the last 24hrs (although that could probably be changed to 12hrs)

iandunn commented 7 years ago

371a05b mitigates the issue by lowering the threshold to 24 hours on the plugin side, instead of 24 hours on the API side, but ideally we'll expand on that in a future commit to trim events after it passes midnight in the current users timezone (on the fly like it is now, not via cron).

iandunn commented 7 years ago

We should also add unit tests to cover trim_events().