Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Datepicker invalid week numbers #3120

Closed
bolemeus opened this issue Dec 17, 2014 · 3 comments
Closed

Datepicker invalid week numbers #3120

bolemeus opened this issue Dec 17, 2014 · 3 comments

Comments

@bolemeus
Copy link

I've set the first day of my datepickers to 1, meaning the weeks start on monday.

I'm encountering a strange bug now though. December of this year (2014) shows a full week of January (5-1 / 11-1). The datepicker also says this is week 54. The week before that is week 53 according to the datepicker. These weeks should be week 1 and 2.

image

Even stranger behaviour is when I check out December 2015 and January 2016.

image
image

The numbering of weeks is wrong. The numbering is correct again in February 2016. I haven't checked out more years, but I'm guessing thesame problem arises...

@brentmiller
Copy link

I confirmed this bug in the following environment:

  • Angular Bootstrap version 0.12.0
  • Angular version 1.2.19
  • Chrome 39 (in addition to IE 11)
  • Windows 7

@stephanmullerNL
Copy link

An additional problem with this is that even the week numbers in December are wrong. 2014's week 52 was the week that started with December 22 (or December 21 if you start on Sundays). The week numbers are off by +1.

All this was already covered in #2506, it seems a fix for that issue was already committed but the guy never updated his code after review feedback was provided. I will look into this tomorrow and update the pull request.

@stephanmullerNL
Copy link

A fix for the starting day that PR references had already been made in the meantime, I added fixes for the January week numbers and adjusted the algorithm to remove the wrong offset in all week numbers. New PR here: #3158

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

No branches or pull requests

4 participants