question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Locale prop no longer working

See original GitHub issue

Issue Description

The prop locale doesn’t seem to work anymore for the time separators in the chat.

Steps to Reproduce / Code Snippets

You find it here: https://snack.expo.io/SJD3c-swG

import React, { Component } from 'react';
import { View } from 'react-native';
import { GiftedChat } from 'react-native-gifted-chat' // 0.3.0

export default class App extends Component {
  render() {
    const userId= '123';
    const messages = [{
      _id: '1',
      createdAt: 1519225196922,
      text: 'Hello',
      user: {
        _id: userId,
        name: "Name",
      },
    }]
    return (
      <View style={{flex:1}}>
        <GiftedChat
          messages={messages}
          user={{ _id: userId }}
          dateFormat={'dddd DD. MMMM'}
          locale={'nb'}
        />
      </View>
    );
  }
}

Expected Results

That the time separator should be in norwegian (according to locale prop)

Additional Information

  • Nodejs version: 7.5.0
  • React version: 16.2.0
  • React Native version: 0.52
  • react-native-gifted-chat version: 0.3.0
  • Platform(s) (iOS, Android, or both?): At least on iOS (haven’t tested android)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
mafiusucommented, Feb 21, 2018

Having the same issue. But it’s working if you import this

import "moment";
import "moment/locale/nb";
1reaction
xcarpentiercommented, May 7, 2020

#1397 we will use dayjs instead

Read more comments on GitHub >

github_iconTop Results From Across the Web

Locale prop not working after update to version 1.0.4 #2293
Issue Description After an update to the version 1.0.4 from 0.16.3 the locale prop of the GiftedChat component doesn't seem to work anymore....
Read more >
React - setting local state with props not working
I am trying to set the local state from a prop, like this: constructor() { super(); this.toggleDetails = this.toggleDetails.bind(this); this ...
Read more >
DLGF: Personal Property - IN.gov
Inventory is no longer taxed. Licensed motor vehicles, trailers, motorized boats, most airplanes, campers, recreational vehicles, and other registered ...
Read more >
Context - React
Context provides a way to pass data through the component tree without having to pass props down manually at every level. In a...
Read more >
TAX CODE CHAPTER 25. LOCAL APPRAISAL
A contract for private appraisal services is void if the amount of compensation to be paid the private appraisal firm is contingent on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found