Language: Days get settled language but months don't
See original GitHub issueHi guys, I have an issue I hope you can help. The question is in the title, the settled language is in French, so days are in French but months stay in English. I tried everything I could, I think you guys would be better than me. I’m sure the problem is very simple, but I don’t see it !
The baby coder that I am thanks you a lot !
import React, { Component } from 'react'
import { SingleDatePicker } from 'react-dates'
import moment from 'moment'
moment.locale('fr')
class DatePicker extends Component {
state = {}
componentWillReceiveProps (props) {
if (props.focused) {
this.setState({focused: props.focused})
}
}
handleChange = (onChange, value) => {
this.setState({ focused: false }, () => {
onChange(value)
})
}
render () {
const { input: { onChange, value } } = this.props
return (
<SingleDatePicker
date={value || null}
onDateChange={(value) => this.handleChange(onChange, value)}
focused={this.state.focused}
onFocusChange={({ focused }) => this.setState({ focused })}
numberOfMonths={1}
displayFormat={() => moment.localeData('fr').longDateFormat('L')}
/>
)
}
}
export default DatePicker
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:7 (1 by maintainers)
Top Results From Across the Web
How Long Does it Take to Become Fluent in a Language?
The answer is: it depends. You first need to understand that learning a language never ends. Settle in for a long ride. But,...
Read more >Selective mutism - NHS
Find out about selective mutism, a severe anxiety disorder that prevents people from speaking in certain social situations.
Read more >A glossary of terms used in payments and settlement systems
The Committee on Payment and Settlement Systems (CPSS) is publishing this comprehensive glossary of payment system terminology as a reference document for ...
Read more >Baby cues & baby body language: a guide
Baby body language gives cues to whether babies are tired or hungry, want to play or need a break. Our guide has videos...
Read more >Workers' Compensation Understanding the Claims Process
To contest a claim, an insurer must notify you and file a notice of controversy with the Board within 18 days after the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve a similar problem, solved adding a
import 'moment/locale/fr'
after moment importWe need to submit a PR to make this happen! 🎉