Loomio
Fri 26 Apr 2013 12:51AM

Autodetect Time Zone

RG Robert Guthrie Public Seen by 38

See my comment.. as the summary box does not support mentions .. and I wish it was just the first comment anyway. (soon.. sooon..)

RG

Robert Guthrie Fri 26 Apr 2013 12:51AM

Yo @aaronthornton I've just pushed changes into new-group-wizard that will autodetect the user timezone when they login or signup via invitation (currently the only way to sign up).

@jonlemmon :
This reads the timezone from the browser at the login or signup screen and inserts the tz value into the login/signup form before they submit. By the time they have authenticated the current_user will have the time_zone saved.

There are two cuke scenarios in features/autodetect_time_zone.feature if you wanna see

Currently if a valid timezone is autodetected, it will overwrite any timezone value they have - so I've removed the select from the user settings form. Until we find a reason not to, I think we should always just autodetect the timezone and use it.

JL

Jon Lemmon Fri 26 Apr 2013 2:02AM

@robertguthrie what about when I fly to japan and start using Loomio there on my laptop? With the implementation you've described, as long as I'm still logged in it will still be set to using NZ time-zone even though I'm in Japan, aye?

It also means that if someone goes into the user settings and changes their time-zone (say for instance, because auto-detect might be incorrect in Egypt) their selection will be overridden the next time they log in right?

On first impression this implementation seems a bit fishy to me.

RG

Robert Guthrie Fri 26 Apr 2013 3:26AM

Yep. It detects when you login - so won't change mid session.

I've removed tz selection from user settings because I'm going to assume that autodetection will give us correct values. I think that is a fair enough thing to do at this stage - I'd be happy to create a manual override when we need it but right now I don't think we do.

JL

Jon Lemmon Fri 26 Apr 2013 5:48AM

@robertguthrie I agree that we don't need the selection at the moment on the user page.

I find it a bit strange that it won't change mid session though. Could we set it when they visit the new/edit motion page?

All said though, it's probably not a huge deal if a few people travelling between time zones have to change the time zone. Happy to trust your instincts here. =)