publiclab / plots2

a collaborative knowledge-exchange platform in Rails; we welcome first-time contributors! :balloon:
https://publiclab.org
GNU General Public License v3.0
956 stars 1.83k forks source link

Record peoples' timezones #2278

Open jywarren opened 6 years ago

jywarren commented 6 years ago

We should record peoples' time zones automatically because we're going to need to:

This has some guidance on this: http://nithinbekal.com/posts/rails-user-timezones/

I was hoping we could do this initially with a button on the profile page, that detects time zone and saves it as a profile tag like timezone:-06:00 or timezone:+4:30 which we could parse for later use.

On the profile page, we should be able to use addTag(tagname):

https://github.com/publiclab/plots2/blob/24b67d65f2bd7ec915c83ccbde4566796fede0b3/app/views/tag/_replication.html.erb#L24

Later, we would want to add a follow-up issue of using the timezone tag in https://github.com/publiclab/plots2/blob/master/app/views/tag/rss.rss.builder to set the default timezone, using Ruby time zone methods:

http://api.rubyonrails.org/classes/ActiveSupport/TimeZone.html#method-i-iso8601

amitsin6h commented 6 years ago

want to work on this issue as no first-timer-only found. @jywarren

grvsachdeva commented 6 years ago

hi @amitsin6h you can take this issue or you can see here for fto candidate(they are close to first-timer issue).

amitsin6h commented 6 years ago

@Gauravano also most of the fto issues are also taken

grvsachdeva commented 6 years ago

If you can solve this one that would be great !!

f3mshep commented 6 years ago

@amitsin6h Are you still looking into this? Would you be interested in pair programming if you are stuck?

amitsin6h commented 6 years ago

@f3mshep yeah sure. I have some issues also , I can also discuss with you.

jywarren commented 6 years ago

Hi, all -- let's try to solve this in a new controller method in the users_controller, something like def timezone -- where we could use code similar to this to create the user tag in the format above:

https://github.com/publiclab/plots2/blob/master/app/controllers/user_tags_controller.rb#L19-L26

What do you think?