-
Notifications
You must be signed in to change notification settings - Fork 281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting the name of a region #160
Comments
Hi @samstickland! Sorry for the delay, had a busy week. Currently I don't think we can give you what you seem to need. All I can give you at the moment is a list of all of the regions we have available: Holidays.load_all
Holidays.regions # <- returns an array of all available region symbols (i.e. :gb, :us, etc) This isn't exactly what you want but currently we don't map an English name, let alone a i18n'ed name. That'll have to be something we add. As to your second point, the issue is that I'll need to think about this as well, as I can definitely see a use for it but up to this stage we haven't needed to do it. In our current nomenclature we would want to do something like These are a reasonable requests. I'm going to leave this open as a feature request and work on it in the near future, I think it's doable. No timeframe at this time, though. |
If you have the countries gem installed then you can do something like this...
BTW, 'Christmas Day' does not seem to be listed as a holiday for Australia (:au). |
@jlsync Hm, interesting! Unfortunately one problem is that not all of our regions are currently ISO compatible, I don't think. Since I've taken over any new regions must be and I've been correcting them as I've found issues but I would have to do an audit to figure out which ones are 'incorrect' currently. Still a good option to have, though. Thank you! To your second point, bah! I missed this in past refactorings. I'm going to create another issue so I don't lose track of it. Thank you! |
I went through the symbols and found the names for each of them and put them in a hash in this gist. (It's already slightly out of date with the latest changes to the definitions from a month ago but should be quite fast to clean it up). A bit of feedback about things I discovered while going through the list: Duplicates
Very detailed sub-regions and organizations
|
Add Nigerian Holidays
Hi,
I'm trying to use this in an application to mark Bank Holidays in a user's calendar.
In order to make this work I'm assuming I need to collect the region a user is in, and to do that I'm going to need a list of regions, converted to English names (at the very least, possibly I18n'ed names in the future).
Is there anyway to do that?
Also, there seems to be some regions I wouldn't want a user to select. For example, if gb_con (Cornwall) is selected, then this will no longer show Easter Monday in England, which is incorrect:
The text was updated successfully, but these errors were encountered: