Skip to content

Commit 0e1d194

Browse files
docs: apply suggestions from code review
Co-authored-by: Anton Arnautov <43254280+arnautov-anton@users.noreply.github.com>
1 parent 493c06c commit 0e1d194

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docusaurus/docs/React/guides/date-time-formatting.mdx

+3-3
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,15 @@ const CustomMessageTimestamp = (props: MessageTimestampProps) => (
144144
);
145145
```
146146

147-
Now we can apply custom configuration in all the translation JSON files. It could look similar to the following example key-value pair.
147+
Now we can apply custom configuration in all the translation JSON files. It could look similar to the following key-value pair example.
148148

149149
```json
150150
{
151151
"timestamp/SystemMessage": "{{ timestamp | timestampFormatter(format: YYYY) }}"
152152
}
153153
```
154154

155-
Besides overriding the formatting parameters above, we can customize the translation key via `timestampTranslationKey` prop all the above components (`DateSeparator`, `EventComponent`, `MessageTimestamp`).
155+
Besides overriding the formatting parameters above, we can customize the translation key via `timestampTranslationKey` prop in all of the above mentioned components (`DateSeparator`, `EventComponent`, `MessageTimestamp`).
156156

157157
```tsx
158158
import { MessageTimestampProps, MessageTimestamp } from 'stream-chat-react';
@@ -176,7 +176,7 @@ Let's dissect the example:
176176
- variable `timestamp` is the name of variable which value will be inserted into the string
177177
- value separator `|` signals the separation between the interpolated value and the formatting function name
178178
- `timestampFormatter` is the name of the formatting function that is used to convert the `timestamp` value into desired format
179-
- the `timestampFormatter` is can be passed the same parameters as the React components (`calendar`, `calendarFormats`, `format`) as if the function was called with these values. The values can be simple scalar values as well as objects (note `calendarFormats` should be an object)
179+
- the `timestampFormatter` can be passed the same parameters as the React components (`calendar`, `calendarFormats`, `format`) as if the function was called with these values. The values can be simple scalar values as well as objects (note `calendarFormats` should be an object)
180180

181181
:::note
182182
The described rules follow the formatting rules required by the i18n library used under the hood - `i18next`. You can learn more about the rules in [the formatting section of the `i18next` documentation](https://www.i18next.com/translation-function/formatting#basic-usage).

0 commit comments

Comments
 (0)