From e3218f9599d31b7a6cac3a6db4d083d7a4804e50 Mon Sep 17 00:00:00 2001 From: Yosmany Garcia Date: Fri, 28 Oct 2016 16:27:23 -0700 Subject: [PATCH 1/2] Added property for time format --- src/Time.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Time.js b/src/Time.js index c95a4d937..7e614fc62 100644 --- a/src/Time.js +++ b/src/Time.js @@ -12,7 +12,7 @@ export default class Time extends React.Component { return ( - {moment(this.props.currentMessage.createdAt).locale(this.context.getLocale()).format('LT')} + {moment(this.props.currentMessage.createdAt).locale(this.context.getLocale()).format(this.props.timeFormat)} ); @@ -63,6 +63,7 @@ Time.defaultProps = { }, containerStyle: {}, textStyle: {}, + timeFormat: 'LT' }; Time.propTypes = { @@ -76,4 +77,5 @@ Time.propTypes = { left: Text.propTypes.style, right: Text.propTypes.style, }), + timeFormat: React.PropTypes.string }; From b4f7a26638b733ceb46d3cd7cea4037fea7700bc Mon Sep 17 00:00:00 2001 From: Yosmany Garcia Date: Fri, 28 Oct 2016 16:30:48 -0700 Subject: [PATCH 2/2] Added property to readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f8e64fe12..d8a880d33 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,7 @@ See [example/App.js](example/App.js) - **`user`** _(Object)_ - user sending the messages `{_id, name, avatar}` - **`onSend`** _(Function)_ - function to call when sending a message - **`locale`** _(String)_ - localize the dates +- **`timeFormat`** _(String)_ - format for time - **`isAnimated`** _(Bool)_ - animates the view when the keyboard appears - **`loadEarlier`** _(Bool)_ - enables the load earlier message button - **`onLoadEarlier`** _(Function)_ - function to call when loading earlier messages