Giter VIP home page Giter VIP logo

Comments (35)

eternicode avatar eternicode commented on May 12, 2024

@caarlos0 thanks!

Just to be clear, the linked site (eyecon.ro) isn't mine, but the original author's. I've just made improvements on his original plugin -- he hasn't responded to my comments on his site, though, so I would imagine his site is using a very old version of the plugin.

I can't replicate the bug on Chrome 18/WinXP -- can you give a specific list of steps you take to get it to show like that? I've just gone through February 2010 - February 2020 with the arrows, and all months displayed as expected.

As for adding the plugin to your project, it's licensed under the Apache 2.0 license. If that license is compatible with your project, I have no objection to it.

from bootstrap-datepicker.

caarlos0 avatar caarlos0 commented on May 12, 2024

Ok man!

I'll try to port it to GWT, and will add credits for you :)

Thanks :) 👍

from bootstrap-datepicker.

everton avatar everton commented on May 12, 2024

Apparently, the bug is something in Date#setDate, the bug disappear if you replace it by #setTime:

diff --git a/js/bootstrap-datepicker.js b/js/bootstrap-datepicker.js
index d11b2ed..5b2f848 100644
--- a/js/bootstrap-datepicker.js
+++ b/js/bootstrap-datepicker.js
@@ -276,7 +276,8 @@
                                if (prevMonth.getDay() == this.weekEnd) {
                                        html.push('</tr>');
                                }
-                               prevMonth.setDate(prevMonth.getDate()+1);
+
+                               prevMonth.setTime(prevMonth.getTime() + 86400000);
                        }
                        this.picker.find('.datepicker-days tbody').empty().append(html.join(''));
                        var currentYear = this.date.getFullYear();

from bootstrap-datepicker.

eternicode avatar eternicode commented on May 12, 2024

@everton were you able to replicate this? Can you outline the steps you took to do so? I'd appreciate the info, thanks!

from bootstrap-datepicker.

everton avatar everton commented on May 12, 2024

The bug happen everywhere, I just take the plugin into my app, go for the October/2012 and have the exactly same thing that the print screen above.

The same bug occurs into Firefox 9+, Chrome and IE8...

I really don't understand difficult to reproduce the bug, all members of my team (5 developers) has the exactly same bug, into Windows, Linux and Mac environments.

from bootstrap-datepicker.

caarlos0 avatar caarlos0 commented on May 12, 2024

Could it be a timezone issue? Whats your timezone?

On Fri, Jun 1, 2012 at 2:20 PM, Everton J. Carpes <
[email protected]

wrote:

The bug happen everywhere, I just take the plugin into my app, go for the
October/2012 and have the exactly same thing that the print screen above.

The same bug occurs into Firefox 9+, Chrome and IE8...

I really don't understand difficult to reproduce the bug, all members of
my team (5 developers) has the exactly same bug, into Windows, Linux and
Mac environments.


Reply to this email directly or view it on GitHub:

#20 (comment)

Atenciosamente,
Carlos Alexandro Becker
https://profiles.google.com/caarlos0

from bootstrap-datepicker.

everton avatar everton commented on May 12, 2024

We are at Brazil, our timezone is: GMT-3

from bootstrap-datepicker.

caarlos0 avatar caarlos0 commented on May 12, 2024

I'm at brazil too, and was expecting this bug too. (also GMT-3).

Take a look here: http://gwtbootstrap.github.com/#datepicker

It could be the locale..

On Fri, Jun 1, 2012 at 2:32 PM, Everton J. Carpes <
[email protected]

wrote:

We are at Brazil, our timezone is: GMT-3


Reply to this email directly or view it on GitHub:

#20 (comment)

Atenciosamente,
Carlos Alexandro Becker
https://profiles.google.com/caarlos0

from bootstrap-datepicker.

eternicode avatar eternicode commented on May 12, 2024

Aha! After setting my system timezone to America/Asuncion, I see the bug -- there's a duplicate October 6, 2012. Coincidentally, this is when Asuncion jumps ahead 1hr, so it looks like a DST bug (though it seems it doesn't affect all TZs).

Now that I'm finally able to replicate it, I can look at building tests and a solution for it. Thanks @everton and @caarlos0!

from bootstrap-datepicker.

caarlos0 avatar caarlos0 commented on May 12, 2024

You're welcome :D

If you need help, please let me know. I'll glad to help =)

On Fri, Jun 1, 2012 at 3:19 PM, Andrew Rowls <
[email protected]

wrote:

Aha! After setting my system timezone to America/Asuncion, I see the bug
-- there's a duplicate October 6, 2012. Coincidentally, this is when
Asuncion jumps ahead 1hr, so it looks
like a DST bug (though it seems it doesn't affect all TZs).

Now that I'm finally able to replicate it, I can look at building tests
and a solution for it. Thanks @everton and @caarlos0!


Reply to this email directly or view it on GitHub:

#20 (comment)

Atenciosamente,
Carlos Alexandro Becker
https://profiles.google.com/caarlos0

from bootstrap-datepicker.

everton avatar everton commented on May 12, 2024

+1

from bootstrap-datepicker.

caarlos0 avatar caarlos0 commented on May 12, 2024

is it fixed?

from bootstrap-datepicker.

caarlos0 avatar caarlos0 commented on May 12, 2024

hey @everton , I do your fix in my local, and it works for october/2012, but break february/2013 :)

from bootstrap-datepicker.

caarlos0 avatar caarlos0 commented on May 12, 2024

actually, it breaks all february's

from bootstrap-datepicker.

eternicode avatar eternicode commented on May 12, 2024

No, I haven't done anything on this yet -- the past few weekends have been too low on free time.

@caarlos0 if you want to give it a shot, that'd be cool. If you can come up with some tests alongside any fixes, that'd be even better :)

from bootstrap-datepicker.

caarlos0 avatar caarlos0 commented on May 12, 2024

I trying something here... but I dont have many exp with handling dates in
JS... I also tried using setUTCDate, without success..

On Fri, Jun 22, 2012 at 10:13 PM, Andrew Rowls <
[email protected]

wrote:

No, I haven't done anything on this yet -- the past few weekends have been
too low on free time.

@caarlos0 if you want to give it a shot, that'd be cool. If you can come
up with some tests alongside any fixes, that'd be even better :)


Reply to this email directly or view it on GitHub:

#20 (comment)

Atenciosamente,
Carlos Alexandro Becker
https://profiles.google.com/caarlos0

from bootstrap-datepicker.

eternicode avatar eternicode commented on May 12, 2024

Fixed with ba6da0a

Unfortunately, there's not any way (that I can see) to build a unit test for this particular behavior. We can mock current date, but not client/system timezone!

from bootstrap-datepicker.

caarlos0 avatar caarlos0 commented on May 12, 2024

thanks, tonight I'll take a look.

from bootstrap-datepicker.

caarlos0 avatar caarlos0 commented on May 12, 2024

Didn't work in GMT-3. Same bug.

In addiction, oct/27 goes to the sunday column.

from bootstrap-datepicker.

eternicode avatar eternicode commented on May 12, 2024

I've just tried three more GMT-3 TZs, none have any problems with October. Are you sure you're using latest master?

from bootstrap-datepicker.

caarlos0 avatar caarlos0 commented on May 12, 2024

Yes, take a look at this fiddle: http://jsfiddle.net/caarlos0/p8Xnk/

It gives me this result: test

Thanks.

from bootstrap-datepicker.

eternicode avatar eternicode commented on May 12, 2024

I'm unable to replicate that result in that fiddle. I may try some other timezones later, but all the ones I've tried so far have behaved properly. What a pain :/

from bootstrap-datepicker.

caarlos0 avatar caarlos0 commented on May 12, 2024

:/

OK man, let me know if you need help to test or something...

thanks :)

from bootstrap-datepicker.

edgardmessias avatar edgardmessias commented on May 12, 2024

I have a sugstão and worked here, instead of:
prevDate = prevMonth.getDate();
prevMonth.setDate(prevMonth.getDate()+1);
put:
prevDate = prevMonth.getDate();
prevMonth.setHours(1, 0, 0, 0);
prevMonth.setDate(prevMonth.getDate()+1);

The months of October and February were right.

from bootstrap-datepicker.

eternicode avatar eternicode commented on May 12, 2024

The "correct" solution to this bug is likely to move all date handling to UTC dates. Which probably should be done anyway :)

from bootstrap-datepicker.

caarlos0 avatar caarlos0 commented on May 12, 2024

Yeah, good idea, use UTC should fix this...

On Thu, Jun 28, 2012 at 5:40 PM, Andrew Rowls <
[email protected]

wrote:

The "correct" solution to this bug is likely to move all date handling to
UTC dates. Which probably should be done anyway :)


Reply to this email directly or view it on GitHub:

#20 (comment)

Atenciosamente,
Carlos Alexandro Becker
https://profiles.google.com/caarlos0

from bootstrap-datepicker.

caarlos0 avatar caarlos0 commented on May 12, 2024

also, this datepicker works great: http://stefangabos.ro/jquery/zebra-datepicker/

maybe you can take a look at the code :D

from bootstrap-datepicker.

edgardmessias avatar edgardmessias commented on May 12, 2024

See http://momentjs.com/

from bootstrap-datepicker.

eternicode avatar eternicode commented on May 12, 2024

@edgardmessias if you're suggesting integration with momentjs, that's already been brought up and rejected in #24

from bootstrap-datepicker.

edgardmessias avatar edgardmessias commented on May 12, 2024

I thought of studying the computation of the sum of dates this plugin.
Sorry for the English, but I'm from Brazil and I'm still studying.

from bootstrap-datepicker.

eternicode avatar eternicode commented on May 12, 2024

Ah, ok. Well, first I'd like to simply move to UTC dates, and see if that fixes a lot of problems. If we still have issues, then we'll start looking at how various libraries do it.

from bootstrap-datepicker.

eternicode avatar eternicode commented on May 12, 2024

I've reverted the last sad attempt to fix this DST bug and pushed a patch that moves everything to UTC dates. Testing would be appreciated.

This fixes it for the TZs I saw it in, so I'm once again closing this issue until somebody finds another edge case ;)

from bootstrap-datepicker.

caarlos0 avatar caarlos0 commented on May 12, 2024

Thanks, I'll test it later ,:)
Em 13/08/2012 14:53, "Andrew Rowls" [email protected] escreveu:

I've reverted the last sad attempt to fix this DST bug and pushed a patch
that moves everything to UTC dates. Testing would be appreciated.

This fixes it for the TZs I saw it in, so I'm once again closing this
issue until somebody finds another edge case ;)


Reply to this email directly or view it on GitHubhttps://github.com//issues/20#issuecomment-7700270.

from bootstrap-datepicker.

eternicode avatar eternicode commented on May 12, 2024

Derp, somehow I forgot to push the changes. Pushed now, my bad.

from bootstrap-datepicker.

bruno-lopes avatar bruno-lopes commented on May 12, 2024

Hi everybody. Is this bug fixed?

from bootstrap-datepicker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.