views:

173

answers:

1

I know there's a dropdown selector for timezone, but I was hoping for a map where the user can click on a region and have that set a hidden field for what time zone it is.

+1  A: 

I don't know if it has been done, but it's a great idea. You could do one based on google maps - the difficulty is the time zone lines aren't all straight so the algorithm would be a little tricky.

However, getting a (lat,lng) pair (latitude and longitude) from a click on a google map is easy - so all you would need is a function to convert (lat,lng) to a timezone - something like this may have been done already and might be easier to find.

Hope this helps a bit. You might consider contributing it back to rails if you do it, it would be a great thing to have.

edit:

after a bit of searching, I found a webservice that converts lat,long to timezone information, here:

http://www.earthtools.org/webservices.htm#timezone

So, you could put up a google map, allow a click to set/drag a marker and then use the webservice to get the timezone offset. Not the off the shelf solution you were looking for, but it may be a solution.

frankodwyer