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

date picker dont chage with change locale #1250

Closed
zgolmohamadi opened this issue Feb 2, 2018 · 2 comments
Closed

date picker dont chage with change locale #1250

zgolmohamadi opened this issue Feb 2, 2018 · 2 comments
Labels

Comments

@zgolmohamadi
Copy link

zgolmohamadi commented Feb 2, 2018

capture
hello
i set locale prop in datePicker and import 'moment/locale/fa' , but just font change to persian , and datepicker load en .

it is my code:
import React from 'react';
import moment from 'moment';
import 'moment/locale/fa';

import DatePicker from 'react-datepicker';
import 'react-datepicker/dist/react-datepicker.css';

export default class Calendar extends React.Component {
constructor (props) {
super(props)
this.state = {
startDate: moment()
};
this.handleChange = this.handleChange.bind(this);
}

handleChange(date) {
this.setState({
startDate: date
});
}
render() {
moment.updateLocale('fa',null)
return ;
}
}

Thank you if you answer

@brian-lim-42
Copy link

Hello,

I got around this by passing in a "selected" value even if it is a custom moment, then using a custom input with a value of blank to show nothing

Create localized moment like this

moment().locale('fa')

~B

@stale
Copy link

stale bot commented Aug 30, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Aug 30, 2019
@stale stale bot closed this as completed Sep 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants