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

Week day name bug #31

Closed
jamie-nxtgencare opened this issue May 11, 2018 · 2 comments
Closed

Week day name bug #31

jamie-nxtgencare opened this issue May 11, 2018 · 2 comments

Comments

@jamie-nxtgencare
Copy link
Contributor

jamie-nxtgencare commented May 11, 2018

Retrieving the week day name for a date on a Saturday always returns Sunday. This is because of a bad bug fix from 5 years ago:

codrops/Calendario@0977d07

The bug fixed reads:

Fixed small bug on line 81. dateProp.weekdayname would be undefined if it's sunday (idx+self.options.startIn would be 7 and thus the options.weeks array would return undefined)

While they are correct if self.options.startln is 1, if you don't set that to 1, then you move Saturday to Sunday needlessly. This line should be:

'weekdayname' : self.options.weeks[($(this).index() + self.options.startIn) % 7],

jamie-nxtgencare pushed a commit to jamie-nxtgencare/Calendario that referenced this issue May 11, 2018
@deviprsd
Copy link
Collaborator

Looks good, I'll do a little bit more test and merge the pull request.

@jamie-nxtgencare
Copy link
Contributor Author

👍

deviprsd added a commit that referenced this issue May 23, 2018
deviprsd added a commit that referenced this issue May 23, 2018
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

2 participants