github / training.github.com

Legacy (no longer published) GitHub Training site
79 stars 46 forks source link

Add time zone calculator to all time-based links #105

Closed matthewmccullough closed 10 years ago

matthewmccullough commented 11 years ago

@kdaigle has indicated he has a new bit of code that will help make any time-based mention, such as those in:

discover the user's time zone, save the preference, and display an event in the user's local time.

kdaigle commented 11 years ago

So, I've started by building it as a separate app I was going to just launch and open source so anyone can use it. Let me know if that'd be a problem/you'd prefer it built into training.

The workflow will probably end up looking like this:

  1. You could use a little builder to generate a URL. The URL will hold all the information about the date/time. My initial thought on this would be that you'd only have time related information in the URL (no "event name" or that sort of thing). The goal with this was to not keep any state information in this little app. The resulting URL would look something like this: http://localhost:9393/2013/6/13/7/00/PM/-06. Because the format is relatively simple, you could likely generate the URL within the training app and just use it where needed built dynamically from the event times.
  2. When anyone clicks on that URL, they'll get presented with a page showing the event's local time as configured. If this is the first time the user has been to the time zone site, we'll attempt to guess their time zone and ask them to confirm it. Once they confirm it, we'll drop a cookie and remember their time zone for all future visits or until reset. We will then show something along the lines of "...but in your time zone, the time will be XYZ".

Let me know if I'm missing anything major. Hopefully this will be helpful!

matthewmccullough commented 11 years ago

This is going to be so helpful. I don't see any reason to have you change course on it being a separate app, so long as we can still somehow juice benefit from it for the training site and training app. :+1:

This sounds like it covers more than what we could ever achieve with the ones that are available today on the 'net. CCing @github/training-team for thoughts.

Pretty darn excited about this!

tlberglund commented 11 years ago

@kdaigle Sounds like coolness. Some thoughts:

The details of the Training site flow may be uninteresting to you, but to do what I have suggested, I think your API has to change. So, two questions:

  1. Everyone, @kdaigle included, what do you think of this?
  2. @kdaigle (to the exclusion of everyone), is this reasonable to do to your time zone service?
kdaigle commented 11 years ago

After chatting with @matthewmccullough, I was considering doing a little JS snippet that you could attach to an element and have it convert the time. I can likely do something like that but I'm not sure how to best handle the guessing/confirmation of the user's time zone since I'd be dropping a third party cookie (my CORS-fu is weak). I can definitely explore it though if y'all prefer it.

My main idea with a completely separate domain/site was it'd be a consistent experience for anyone who wants to use it. I wonder if people would be confused by the times "magically" being in their zone on the site. I know, personally, I always assume they're not in EST and need converting.

matthewmccullough commented 11 years ago

We publish static times today and then link to a translation page, so even leveling that up and having it be consistent would be a step-wise win.

Also, think of all the places on GitHub.com that could benefit from this. If commit times (since Git commits have TZ offsets) could link to this, Issue time-stamps, etc, it could be a great reason to have https://timezone.github.com be a real app used by tons of our internal and public-facing services.

brntbeer commented 11 years ago

@kdaigle stole the words out of my mouth: JS snippet. I think that'd be key for a light weight site like this.

A rails gem could be cool too if this wasnt just jekyll

afeld commented 11 years ago

Huge :+1: on this. http://momentjs.com/ may come in handy.

jordanmccullough commented 11 years ago

:+1: on MomentJS indeed.

kdaigle commented 11 years ago

I'm happy to try integrating the MomentJS code if you'd like. I haven't picked up the time zone work in a more serious way after I realized the complexities of managing time zones. :grinning:

matthewmccullough commented 11 years ago

@kdaigle I'd love to have the benefit of your time on an attempted MomentJS integration, if you have some spare cycles. Still need better TZ calculations and displays for our customers as much as ever.

matthewmccullough commented 10 years ago

Migrated to new web site repo