Skip to content
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

Lavachart america/sao_paulo is not a valid timezone #256

Closed
NelsonBaez opened this issue Jul 24, 2018 · 10 comments
Closed

Lavachart america/sao_paulo is not a valid timezone #256

NelsonBaez opened this issue Jul 24, 2018 · 10 comments

Comments

@NelsonBaez
Copy link
Contributor

What Version?

3.1.10

Issue

lavachart is not working with timezone 'America/Sao_Paulo', but the problem only occurs in a centOS with nginx, in my local enviroment with apache it works, any idea?
screenshot_1

@kevinkhill
Copy link
Owner

kevinkhill commented Jul 24, 2018

If you scroll to the end of the file, you can see how the library validates timezones. I thought it would be safe to use builtin php functions to create a validation list.

I don't know why it would be different per environment. Are you using different versions of php?

@NelsonBaez
Copy link
Contributor Author

NelsonBaez commented Jul 25, 2018

yeah, they are different, i checked and in local we use php 7.1.9 and it works, in production we use 7.1.17 and fails, after that, i tried to use php 7.1.17, 7.1.19, 7.1.20 and 7.2.8 locally but it seems that just the 7.1.9 works, i will try this version in the production enviroment later to confirm that.

@NelsonBaez
Copy link
Contributor Author

NelsonBaez commented Jul 25, 2018

i did a var_dump in the timezone_abbreviations_list(), and there are no 'America/Sao_Paulo' abbreviation,
after more research i found this issue that seems related.
bug #338 Fix: Timezone Requirement (felipyamorim)
They fixed by using timezone_identifiers_list() instead of timezone_abbreviations_list(), maybe you can do the same.
Another thing is that in php 7.1.9 there are 'America/Sao_Paulo' in the abbreviation list, i don't know why after that version it got removed.

@kevinkhill
Copy link
Owner

Very strange indeed.... Thank you for looking into this for me. I don't have time to work on it, but if you are willing to make a patch, I'd happily accept a pull request

NelsonBaez added a commit to NelsonBaez/lavacharts that referenced this issue Jul 26, 2018
Lavachart is using listAbbreviations method to check timezone, the recomendation is to use listIdentifiers method instead.

Related Issue:
[Lavachart america/sao_paulo is not a valid timezone kevinkhill#256](kevinkhill#256)
@kevinkhill
Copy link
Owner

Tagged version 3.1.11 with the fix 👍

@NelsonBaez
Copy link
Contributor Author

NelsonBaez commented Jul 27, 2018

Sorry @kevinkhill , i may did something wrong(it was my first pull request), but 3.1.11 isn't with the fix.

@kevinkhill
Copy link
Owner

Honestly, I don't know where your commit went? I am not a git master, but I thought you did it right, and it looks like you pulled against my 3.1 branch, but I don't see it when I pull from github......

@kevinkhill
Copy link
Owner

OK! I think I got it sorted out. Now give it a try 👍

@NelsonBaez
Copy link
Contributor Author

Working 👍

@asllanmaciel
Copy link

i did a var_dump in the timezone_abbreviations_list(), and there are no 'America/Sao_Paulo' abbreviation,
after more research i found this issue that seems related.
bug #338 Fix: Timezone Requirement (felipyamorim)
They fixed by using timezone_identifiers_list() instead of timezone_abbreviations_list(), maybe you can do the same.
Another thing is that in php 7.1.9 there are 'America/Sao_Paulo' in the abbreviation list, i don't know why after that version it got removed.

Fixed with timezone_identifiers_list() (or DateTimeZone::listIdentifiers() ) also!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants