Taymon Beal was pinging us about some help with using the LessWrong API to construct a sidebar for SSC with upcoming meetups. I figured I would write up my response publicly so that other people might be able to learn from it.
As I understand the thing correctly (though Taymon can correct me in the comments) he wanted a way to query the API to get a list of all upcoming SSC meetups. This is the the GraphQL query that I would construct to make that happen (note to myself to fix the code embedding editor component):
{PostsList(terms: {view: "nearbyEvents", filter: "SSC", lat: 0, lng: 0}) {
_id
createdAt
title
mongoLocation
location
}}
You can also play around with this interactively on our GraphiQL page.
The "nearbyEvents" view right now requires you to specify a location, and returns all upcoming meetups (to any point in the future) ordered by their distance from that point. You can find the full definition of that view here.
So correct me if I'm wrong here, but the way timezones seem to work is that, when creating an event, you specify a "local" time, then the app translates that time from whatever it thinks your browser's time zone is into UTC and saves it in the database. When somebody else views the event, the app translates the time in the database from UTC to whatever it thinks their browser's time zone is and displays that.
I suppose this will at least sometimes work okay in practice, but if somebody creates an event in a time zone other than the one they're in right now, it will be wrong, and if you're viewing an event in a different time zone from your own, it'll be unclear which time zone is meant. Also, Moment.js's guess as to the user's time zone is not always reliable.
I think the right way to handle this would be to use the Google Maps API to determine, from the event's location and the given local time, what time zone the event is in, and then to attach that time zone to the time stored in the database and display it explicitly on the page. Does this make sense?