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

Add formatDate to docs #469

Merged
merged 1 commit into from
Jul 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
</head>
<body>
<div id="rsg-root"></div>
<script src="build/bundle.c17a85e0.js"></script>
<script src="build/bundle.513b7d86.js"></script>
</body>
</html>
3 changes: 3 additions & 0 deletions src/components/Message/Message.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ Message.propTypes = {
readBy: PropTypes.array,
/** groupStyles, a list of styles to apply to this message. ie. top, bottom, single etc */
groupStyles: PropTypes.array,

/** Override the default formatting of the date. This is a function that has access to the original date object. Returns a string or Node */
formatDate: PropTypes.func,
/**
* Message UI component to display a message in message list.
* Available from [channel context](https://getstream.github.io/stream-chat-react/#channelcontext)
Expand Down
4 changes: 4 additions & 0 deletions src/components/Message/MessageCommerce.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@ MessageCommerce.propTypes = {
/** Channel config object */
channelConfig: /** @type {PropTypes.Validator<import('stream-chat').ChannelConfig>} */ (PropTypes
.object.isRequired),

/** Override the default formatting of the date. This is a function that has access to the original date object. Returns a string or Node */
formatDate: PropTypes.func,

/** If component is in thread list */
threadList: PropTypes.bool,
/**
Expand Down
4 changes: 4 additions & 0 deletions src/components/Message/MessageLivestream.js
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,10 @@ MessageLivestreamComponent.propTypes = {
unsafeHTML: PropTypes.bool,
/** If its parent message in thread. */
initialMessage: PropTypes.bool,

/** Override the default formatting of the date. This is a function that has access to the original date object. Returns a string or Node */
formatDate: PropTypes.func,

/** Channel config object */
channelConfig: /** @type {PropTypes.Validator<import('stream-chat').ChannelConfig>} */ (PropTypes
.object.isRequired),
Expand Down
2 changes: 2 additions & 0 deletions src/components/Message/MessageSimple.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,8 @@ MessageSimple.propTypes = {
/** Channel config object */
channelConfig: /** @type {PropTypes.Validator<import('stream-chat').ChannelConfig>} */ (PropTypes
.object.isRequired),
/** Override the default formatting of the date. This is a function that has access to the original date object. Returns a string or Node */
formatDate: PropTypes.func,
/** If component is in thread list */
threadList: PropTypes.bool,
/**
Expand Down
3 changes: 3 additions & 0 deletions src/components/Message/MessageTeam.js
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,9 @@ MessageTeam.propTypes = {
clearEditingState: PropTypes.func,
/** Returns true if message belongs to current user */
isMyMessage: PropTypes.func,

/** Override the default formatting of the date. This is a function that has access to the original date object. Returns a string or Node */
formatDate: PropTypes.func,
/**
* Returns all allowed actions on message by current user e.g., [edit, delete, flag, mute]
* Please check [Message](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Message.js) component for default implementation.
Expand Down