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

antd2, DatePicker invalid format #3298

Closed
plandem opened this issue Oct 3, 2016 · 2 comments
Closed

antd2, DatePicker invalid format #3298

plandem opened this issue Oct 3, 2016 · 2 comments

Comments

@plandem
Copy link
Contributor

plandem commented Oct 3, 2016

Looks like DatePicker is not using provided format in some cases:

<DatePicker
    disabledDate={this.disabledToDate}
    format={periodFormat}
    value={moment(item.date_to, periodFormat)}
    placeholder={formatMessage(messages.labelPeriodTo)}
    onChange={ (_, date_to) => this.handleChanges({ date_to }) }
/>

where periodFormat is 'YYYY-MM-DD'. Here is result:

(A) - ok:
https://www.dropbox.com/s/s4tfy9ycwlhcaad/Screenshot%202016-10-03%2017.04.37.png?dl=0

(B) - wrong:
https://www.dropbox.com/s/7wkl73d5ez6j6vy/Screenshot%202016-10-03%2017.05.24.png?dl=0

p.s.: my locale is RU, so by default we have (B) format, but in my case i want always to use (A) variant.

@benjycui
Copy link
Contributor

benjycui commented Oct 8, 2016

Please provide a re-producible demo: http://codepen.io/benjycui/pen/KgPZrE?editors=001

@lock
Copy link

lock bot commented May 3, 2018

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators May 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants