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

isoWeekday is not a function #22

Closed
stockiNail opened this issue Aug 5, 2020 · 5 comments · Fixed by #23
Closed

isoWeekday is not a function #22

stockiNail opened this issue Aug 5, 2020 · 5 comments · Fixed by #23

Comments

@stockiNail
Copy link
Contributor

stockiNail commented Aug 5, 2020

I got an error isoWeekday is not a function when I try to use the startOf method of the adapter.

return this._create(time).isoWeekday(weekday).valueOf();

Having a look to Luxon documentation, the isoWeekday(weekday) sounds to belong to Moment and not to Luxon.

The doc https://github.com/moment/luxon/blob/master/docs/moment.md#unit-getters

EDIT
Chart.js version: dist/master
Luxon adapter: 0.2.1
Luxon lib: 1.24.1

@benmccann
Copy link
Collaborator

Just as a heads up, I don't have time to fix at the moment, but I'll review a PR if you want to take a stab

@stockiNail
Copy link
Contributor Author

@benmccann let me take time because I'm very busy as well but I can try to submit a PR. Ok for you?

@benmccann
Copy link
Collaborator

Sure. No rush

@stockiNail
Copy link
Contributor Author

@benmccann submitted. Take your time!

@stockiNail
Copy link
Contributor Author

@benmccann fixed again in order to:

  1. calculate the right start of week because previously was wrong the calculation when weekday passed as argument was 7 (Sunday)
  2. normalized the weekday passed as argument in order to have always a consistent result even if the weekday argument is not between 1 and 7.

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

Successfully merging a pull request may close this issue.

2 participants