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

Brazil timezone: Two dates repeating on october month. #180

Closed
rdenadai opened this issue Jul 19, 2013 · 24 comments
Closed

Brazil timezone: Two dates repeating on october month. #180

rdenadai opened this issue Jul 19, 2013 · 24 comments
Labels
Milestone

Comments

@rdenadai
Copy link

Hi there!
Found a little bug on the pickadate widget... don't know if this is a specific bug, because i'm from Brazil. Anyway, i attach a image showing the bug...
The october month shows two 19 days... it doesn't matter the year i choose, the same thing occours to other days in october.

pickadata

Thanks

@amsul
Copy link
Owner

amsul commented Jul 26, 2013

That’s really odd. I can’t seem to be able to reproduce this in any locale.

Are you still experiencing this? Can you create a fiddle or something recreating the problem?

@rdenadai
Copy link
Author

Sorry for the delay... i'm made this fiddle with the code i'm using.
http://jsfiddle.net/rdenadai/hm68P/21/

AFAIK the problem must be related with the language i'm using in my machine (which is Portuguese-BR). Will try to verify where's the real problem with this.

thanks

@MrGeneric
Copy link

I'm not seeing a duplicate of the 19th of October on that fiddle.

@rdenadai
Copy link
Author

Ok, 100% sure is related with some configuration of my machine language, i'll try to find out if is related with the OS language or browser selected language.

@rdenadai
Copy link
Author

Ok guys, looking for in the web and doing some test on the code i find the problem... and is related with my timezone.
This stackoverflow thread answers the question why you guys can't replicate the issue => http://stackoverflow.com/questions/16698754/problems-with-the-date-20-october-in-some-years

Anyway, the fastest solution will be to create a new Date object in the following format:
new Date(2013, 9, 20, 1, 0, 0);

Don't know if the can break any part of the calendar since i didn't test extensively with others timezones.

:D cheers!

@amsul
Copy link
Owner

amsul commented Aug 1, 2013

Interesting...

@rdenadai, thanks for finding a solution!

I wonder how other calendar/date plugins handle these cases. I think this might be the only way to make sure that doesn’t happen. Not sure what affect it might have on other timezones either.. I’ll look into it some more when I get the chance.

Cheers!

@rdenadai
Copy link
Author

rdenadai commented Aug 1, 2013

Ok @amsul! Glad i could help... as soon as i have some time will try to test this bug with other timezones.
Meanwhile i will change the pickadate class to correct this feature on my app.

Keep up the good work!
;)

@nford
Copy link

nford commented Jun 19, 2014

We just ran into this bug in the Brazil timezone for October 2014 where the 19th is on a Sunday so we have the 18th repeated twice.

@mdeboer
Copy link
Contributor

mdeboer commented Jun 20, 2014

Have a look if pull request #462 fixes this for you. It uses UTC times instead of local times and should fix timezone related issues.

@nford
Copy link

nford commented Jun 26, 2014

I'll test that out now, thanks. For anyone else wanting to verify this bug, try switching your computer's timezone to Brazil and checking October 18th on any of the pickadate demos: http://amsul.ca/pickadate.js/

@nford
Copy link

nford commented Jun 26, 2014

Looks like that did the trick! Hopefully this will be merged soon.

@mdeboer
Copy link
Contributor

mdeboer commented Jun 26, 2014

Good to hear!

@amsul amsul added this to the 3.5.3 milestone Jul 1, 2014
@amsul
Copy link
Owner

amsul commented Jul 6, 2014

Merged in the fix :)

@amsul amsul closed this as completed Jul 6, 2014
@mauricioacolweb
Copy link

This problem was solved? I need solution...
Thanks

@mdeboer
Copy link
Contributor

mdeboer commented Jul 15, 2014

@mauricioacolweb as you can see the fix was merged. You can either clone the repository or download release 3.5.3 from the releases page which includes this fix.

See #462 which fixes the bug and has been merged.

@amsul
Copy link
Owner

amsul commented Jul 15, 2014

Unfortunately, the merge (#462) had to be reverted. It was causing some unexpected issues.

I’m looking into it at the moment. I’ll try to do a speedy release for this fix with v3.5.4.

@amsul amsul reopened this Jul 15, 2014
@amsul amsul modified the milestones: 3.5.4, 3.5.3 Jul 15, 2014
@mdeboer
Copy link
Contributor

mdeboer commented Jul 18, 2014

Can you tell me what's wrong exactly, is it a very specific case or a bigger problem? Maybe I can help to get it fixed. As far as I'm aware it completed all the tests successfully.

@mauricioacolweb
Copy link

The problem is repeated on the 18th October 2014:
---> http://prntscr.com/43zpgz

And so as it increases year:
---> http://prntscr.com/43zq1g

@amsul
Copy link
Owner

amsul commented Jul 21, 2014

@mdeboer the issue is described here: https://gist.github.com/darrenhaken/213aa476d4f139bb39ea, /cc @darrenhaken

I’m not sure if it’s a concern since the date being set is always going to be relative to the timezone the test is run in. But I wouldn’t mind another set of eyes on it.. The fix is merged into dev again and all the tests are passing.

If it seems good to everyone, I’ll mark a new release.

@darrenhaken
Copy link

Last time the UTC dates were used when I passed a local date in my time
zone to it (via new Date()) the displayed date was behind by a day.

It looked like the date was expected in a UTC format and then was simply
rendered accordingly.

If UTC is used internally I expect that the API should support setting
dates by the user in local time and it should also be displayed in local
time.

I may have missed something on the UTC intentions and if so please shed
some light :)

@nford
Copy link

nford commented Aug 29, 2014

I can confirm that the bug appears to be fixed in the dev branch. Keen to see this merged since we're getting close to October and more of our users are getting into that month in the datepickers.

@amsul
Copy link
Owner

amsul commented Sep 12, 2014

Completed with 6774880

@amsul
Copy link
Owner

amsul commented Oct 5, 2014

I just pushed another fix for this issue 873ce47 which resolves this without the need for UTC dates.

Seems much better to me and also fixes the issue described here #529. If anyone else can also verify I'd appreciate that (cc: @nford @darrenhaken @mauricioacolweb)

@albertjose
Copy link

This problem was solved? For me the problem is repeated in all October months (using Firefox Browser).

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

No branches or pull requests

8 participants