Add Curaçao to ActiveSupport::TimeZone #10276

Closed
acesuares opened this Issue Apr 20, 2013 · 19 comments

Comments

Projects
None yet
10 participants
@acesuares

Or is that a way to do that runtime?

I tried ActiveSupport::TimeZone::zones_map["Curaçao"] = ActiveSupport::TimeZone['La Paz'] but that didn't work, and MAPPING is a frozen hash and can't be modified.

How to add Curaçao to the list of timezones?

@senny

This comment has been minimized.

Show comment Hide comment
@senny

senny Jan 21, 2014

Member
Member

senny commented Jan 21, 2014

@pixeltrix

This comment has been minimized.

Show comment Hide comment
@pixeltrix

pixeltrix Jan 21, 2014

Owner

@acesuares why do you want to add Curaçao to the list of mappings - is it purely for the time_zone_select helper method?

Owner

pixeltrix commented Jan 21, 2014

@acesuares why do you want to add Curaçao to the list of mappings - is it purely for the time_zone_select helper method?

@acesuares

This comment has been minimized.

Show comment Hide comment
@acesuares

acesuares Jan 21, 2014

Curaçao is a country sinds 10-10-'10 and we would like to be able to select the timezone from the dropdown list...!

Curaçao is a country sinds 10-10-'10 and we would like to be able to select the timezone from the dropdown list...!

@rafaelfranca

This comment has been minimized.

Show comment Hide comment
@rafaelfranca

rafaelfranca Jan 21, 2014

Owner

hmmm, I'm starting to think seriously about extracting this helper too as we did with country select.

Owner

rafaelfranca commented Jan 21, 2014

hmmm, I'm starting to think seriously about extracting this helper too as we did with country select.

@vipulnsward

This comment has been minimized.

Show comment Hide comment
@vipulnsward

vipulnsward Jan 21, 2014

Member

I had attempted #10281, would allowing users to add mappings make sense, instead of manually maintaining it.

Member

vipulnsward commented Jan 21, 2014

I had attempted #10281, would allowing users to add mappings make sense, instead of manually maintaining it.

@pixeltrix

This comment has been minimized.

Show comment Hide comment
@pixeltrix

pixeltrix Jan 22, 2014

Owner

@rafaelfranca it does get a bit political, however rather than removing it to a gem how about making the timezone select helper manageable via i18n ?

Owner

pixeltrix commented Jan 22, 2014

@rafaelfranca it does get a bit political, however rather than removing it to a gem how about making the timezone select helper manageable via i18n ?

@rafaelfranca

This comment has been minimized.

Show comment Hide comment
@rafaelfranca

rafaelfranca Jan 22, 2014

Owner

This might work.

Owner

rafaelfranca commented Jan 22, 2014

This might work.

@Kaermes

This comment has been minimized.

Show comment Hide comment
@Kaermes

Kaermes Jan 27, 2014

Taking a look at this the way @pixeltrix suggested.

Kaermes commented Jan 27, 2014

Taking a look at this the way @pixeltrix suggested.

@Kaermes

This comment has been minimized.

Show comment Hide comment
@Kaermes

Kaermes Jan 27, 2014

@pixeltrix Here is one way to solve this via i18n (WIP).

Kaermes commented Jan 27, 2014

@pixeltrix Here is one way to solve this via i18n (WIP).

@acesuares

This comment has been minimized.

Show comment Hide comment
@acesuares

acesuares Jan 27, 2014

Thanks for working on this! Do I understand correctly that I have to add the mapping for every project or will this eventually be in Rails?

Thanks for working on this! Do I understand correctly that I have to add the mapping for every project or will this eventually be in Rails?

@pixeltrix

This comment has been minimized.

Show comment Hide comment
@pixeltrix

pixeltrix Jan 27, 2014

Owner

@acesuares the intention is that this list will be maintained via an application's locale files. The reason is that the list can become politically sensitive so we don't want to become caught in a political dogfight like the old country_select helper did. The other option is we spin it out to a gem.

Owner

pixeltrix commented Jan 27, 2014

@acesuares the intention is that this list will be maintained via an application's locale files. The reason is that the list can become politically sensitive so we don't want to become caught in a political dogfight like the old country_select helper did. The other option is we spin it out to a gem.

@acesuares

This comment has been minimized.

Show comment Hide comment
@acesuares

acesuares Jan 27, 2014

Hmmmm... political eh? This is interesting. And I can understand it, but since Curaçao is a country (and not Curacao! and not Netherlands Antilles!) I would love to see that fixed in the core, so I don't have to do that for every app.

http://www.iso.org/iso/home/news_index/news_archive/news.htm?refid=Ref1383
http://en.wikipedia.org/wiki/ISO_3166-2:CW

So, as far as I can understand the need to avoid politically incorrect time zones (wow!), Curaçao really should be in the list.

As a matter of fact, in many dropdowns, notably the ones from Google, Facebook and other major internet companies, omit .cw or CW or Curaçao and we haven been having trouble getting Apple ID's, Google Developer Accounts, Facebook Ads and what more. Let alone trying to order some stuff from Amazon or E-bay.

Thus my plea.

Hmmmm... political eh? This is interesting. And I can understand it, but since Curaçao is a country (and not Curacao! and not Netherlands Antilles!) I would love to see that fixed in the core, so I don't have to do that for every app.

http://www.iso.org/iso/home/news_index/news_archive/news.htm?refid=Ref1383
http://en.wikipedia.org/wiki/ISO_3166-2:CW

So, as far as I can understand the need to avoid politically incorrect time zones (wow!), Curaçao really should be in the list.

As a matter of fact, in many dropdowns, notably the ones from Google, Facebook and other major internet companies, omit .cw or CW or Curaçao and we haven been having trouble getting Apple ID's, Google Developer Accounts, Facebook Ads and what more. Let alone trying to order some stuff from Amazon or E-bay.

Thus my plea.

@jamo

This comment has been minimized.

Show comment Hide comment
@jamo

jamo Jan 27, 2014

Contributor

Yeah - I understand your points.

IMO. this way as we addressed this in our pull request, it lets everyone define their own lists easily - and also makes localisation/customization easier.
And possibly letting lists be easily modified by gems.

When site is mainly run, lets say in Europe, I would prefer to have multiple choices for European countries and limited choices for Asian and American time zones, as most of users are not located to those time zones. Maybe just one for each time zone...
Just my opinion - I don't want this to get into a time zone helper war :)


Any comments about our implementation of this pull request?
Even if someone ends up adding Curaçao (and maybe other) countries to the list - I would like to see possibility to localize that list.

Contributor

jamo commented Jan 27, 2014

Yeah - I understand your points.

IMO. this way as we addressed this in our pull request, it lets everyone define their own lists easily - and also makes localisation/customization easier.
And possibly letting lists be easily modified by gems.

When site is mainly run, lets say in Europe, I would prefer to have multiple choices for European countries and limited choices for Asian and American time zones, as most of users are not located to those time zones. Maybe just one for each time zone...
Just my opinion - I don't want this to get into a time zone helper war :)


Any comments about our implementation of this pull request?
Even if someone ends up adding Curaçao (and maybe other) countries to the list - I would like to see possibility to localize that list.

@acesuares

This comment has been minimized.

Show comment Hide comment
@acesuares

acesuares Jan 27, 2014

@jamox well, that makes sense too. I could just add some simpel gem to all my apps that makes the correct time zones for Curaçao but maybe even for Bonaire and so on. And limiting the dropdown to only relevant time zones is certainly handy, I didn't realize that was not possible.

@jamox well, that makes sense too. I could just add some simpel gem to all my apps that makes the correct time zones for Curaçao but maybe even for Bonaire and so on. And limiting the dropdown to only relevant time zones is certainly handy, I didn't realize that was not possible.

@acesuares

This comment has been minimized.

Show comment Hide comment
@acesuares

acesuares Feb 12, 2014

any progress?

any progress?

Kaermes added a commit to Kaermes/rails that referenced this issue Feb 15, 2014

Add possibility of overwriting TimeZone default MAPPING.
Allow users to define a smaller/bigger set of time zones or time zones
previously not found in the MAPPING. Example case of the latter is #10276.
Custom zones are given as a hash in a timezones.rb initializer and this hash
acts the new MAPPING.

@acesuares acesuares added the stale label May 27, 2014

@rails-bot

This comment has been minimized.

Show comment Hide comment
@rails-bot

rails-bot May 27, 2014

This issue has been automatically marked as stale because it has not been commented on for at least
three months.

The resources of the Rails team are limited, and so we are asking for your help.

If you can still reproduce this error on the 4-1-stable, 4-0-stable branches or on master,
please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions.

This issue has been automatically marked as stale because it has not been commented on for at least
three months.

The resources of the Rails team are limited, and so we are asking for your help.

If you can still reproduce this error on the 4-1-stable, 4-0-stable branches or on master,
please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions.

@jamo

This comment has been minimized.

Show comment Hide comment
@jamo

jamo May 27, 2014

Contributor

Just to wrap up my thoughts, there is basically no right way to select which timezones should be there by default, so keeping it as it is is the best solution :)

And if this would be made configurable by any way, it just means that users need to update huge lists of timezones.

IHMO the best way is to forget this issue (in Rails core) and make a gem to make it easier to have relevant timezones for each different area.
I might have time for this after one month, I'm moving to another city for a internship soon...

Contributor

jamo commented May 27, 2014

Just to wrap up my thoughts, there is basically no right way to select which timezones should be there by default, so keeping it as it is is the best solution :)

And if this would be made configurable by any way, it just means that users need to update huge lists of timezones.

IHMO the best way is to forget this issue (in Rails core) and make a gem to make it easier to have relevant timezones for each different area.
I might have time for this after one month, I'm moving to another city for a internship soon...

@rafaelfranca rafaelfranca added attached PR and removed stale labels May 27, 2014

@acesuares

This comment has been minimized.

Show comment Hide comment
@acesuares

acesuares May 29, 2014

Thanks @Kaermes, I'll give that a try!

Thanks @Kaermes, I'll give that a try!

@robin850 robin850 added this to the 4.2.0 milestone Jul 21, 2014

@rafaelfranca rafaelfranca modified the milestones: 4.2.0, 5.0.0 Aug 18, 2014

@dhh dhh removed this from the 5.0.0 milestone Dec 27, 2014

@rafaelfranca

This comment has been minimized.

Show comment Hide comment
@rafaelfranca

rafaelfranca Feb 4, 2016

Owner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment