Skip to content

Commit

Permalink
Only set locale if dateLocale prop is passed and update README
Browse files Browse the repository at this point in the history
  • Loading branch information
gnl committed Apr 21, 2016
1 parent 3a68b67 commit 2eb0fdc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion GiftedMessenger.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ class GiftedMessenger extends Component {

Object.assign(this.styles, this.props.styles);

setLocale(this.props.dateLocale);
if (this.props.dateLocale !== '')
setLocale(this.props.dateLocale);
}

componentDidMount() {
Expand Down Expand Up @@ -592,6 +593,7 @@ class GiftedMessenger extends Component {
GiftedMessenger.defaultProps = {
autoFocus: true,
blurOnSubmit: false,
dateLocale: '',
displayNames: true,
displayNamesInsideBubble: false,
forceRenderImage: false,
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ See [GiftedMessengerExample/GiftedMessengerContainer.js](https://raw.githubuserc
| ----------------------------- | -------- | -------------------------------------------------------------------------- | -------- | -------------------------------- |
| autoFocus | Boolean | TextInput auto focus | Both | true |
| blurOnSubmit | Boolean | Dismiss the keyboard when clicking on submit | Both | false |
| dateLocale | String | The moment.js locale used for displaying the message timestamps | Both | '' |
| displayNames | Boolean | Display or not the name of the interlocutor(s) | Both | true |
| displayNamesInsideBubble | Boolean | Display the name of the interlocutor(s) inside the bubble | Both | false |
| forceRenderImage | Boolean | Always render the users images (avatar) | Both | false |
Expand Down

0 comments on commit 2eb0fdc

Please sign in to comment.