bootstrap-year-calendar icon indicating copy to clipboard operation
bootstrap-year-calendar copied to clipboard

2nd Saturday in October is duplicated in Firefox

Open Giovani-Silva opened this issue 7 years ago • 10 comments

2nd Saturday in October is duplicated in Firefox v48.0.2

Giovani-Silva avatar Mar 07 '17 20:03 Giovani-Silva

Duplicate of #54 And it's not happening on 50+ Version of firefox Try with other version and tell us what happen but on the field of #54 imagen

William-H-M avatar Mar 07 '17 21:03 William-H-M

I upgraded to version 52 and still continues to duplicate screenshot_1

Giovani-Silva avatar Mar 07 '17 21:03 Giovani-Silva

Mmm that's weird this could be because of your current timezone right now I'm on GMT -5, I've saw this same problem on Eonasdan Datetime Picker before on this issue , it's because something on JavaScript can you please give us your current timezone or can change yours to +00:00 or GMT -5 like mine and see if this happens too

Good luck!

William-H-M avatar Mar 07 '17 21:03 William-H-M

Sorry for the delay in responding. My time zone is GMT-0300 (Brazil's official time).

I changed to GMT +00: 00 and GMT -05: 00, actually stopped duplicating.

Thank you

Giovani-Silva avatar Mar 09 '17 14:03 Giovani-Silva

Ok great so the problem is actually with JavaScript... this is weird and it's a problem for clients beacuse the date is taking out from the browser, so I'm not sure on how actually do a workaround, maybe @Paul-DS do you know a workaround for this or have you saw this before?

William-H-M avatar Mar 09 '17 15:03 William-H-M

This is really the first time I came across this. The datepicker that mentioned tbm has the same problem.

I'll search and see if I can find a solution.

Giovani-Silva avatar Mar 09 '17 15:03 Giovani-Silva

in _renderBody, i've notices that in some iterations of days, it's adding hours to the currentDate. I'm not sure why, but i'm truncating the currentDate after every iteration.

currentDate.setDate(currentDate.getDate() + 1); currentDate.setHours(0, 0, 0, 0);

It works, but i'm not sure of the real problem.

thiagofraga avatar Apr 17 '17 18:04 thiagofraga

I have fixed:

After line 235: currentDate.setHours(1); After line 237: lastDate.setHours(1); And after line 287: currentDate.setHours(1);

I'll try to send a pullrequest to fix this.

djulianm avatar Jun 27 '17 14:06 djulianm

@djulianm thanks, this worked for me. My problem have been with November 30

hallss93 avatar Aug 10 '18 14:08 hallss93

@djulianm for fixed in my case:

After line 235:

currentDate.setHours(1);
After line 237:
lastDate.setHours(1);
And after line 287:
currentDate.setHours(1);
**lastDate.setHours(1);**

hallss93 avatar Aug 10 '18 14:08 hallss93