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

formatWeekDay is using wrong date-fns format #1594

Closed
lambert-velir opened this issue Dec 24, 2018 · 0 comments
Closed

formatWeekDay is using wrong date-fns format #1594

lambert-velir opened this issue Dec 24, 2018 · 0 comments

Comments

@lambert-velir
Copy link

lambert-velir commented Dec 24, 2018

Expected behavior

formatWeekDay is supposed to be provided the day of the week as a string, eg, "Friday"

Actual behavior

formatWeekDay is being provided a string of numbers, eg, "0016"

Steps to reproduce

<DatePicker
  selected={this.state.date}
  onChange={date => this.setState({ date })}
  formatWeekDay={d => {
    console.log("D", d)
    return d;
  }}
/>

The problem is that package.json has date-fns v2, which has breaking changes, one of which is the format for the day of the week.

To fix this, either change package.json to use version 1 of date-fns, or update this line to have a format of "EEEE"

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