Skip to content

Commit

Permalink
feat: add support for timeZone parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhep committed Apr 20, 2024
1 parent 6f6a9ec commit 1fa31c5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/withReactIntl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ export const withReactIntl = (
const currentLocale = locale || defaultLocale;

if (currentLocale && reactIntl) {
const {formats, messages, defaultRichTextElements} = reactIntl;
const {formats, messages, defaultRichTextElements, timeZone} = reactIntl;
const safeFormats = formats ? formats[currentLocale] : undefined;
if (messages) {
return (
<IntlProvider
timeZone={timeZone}
key={locale}
formats={safeFormats}
messages={messages[currentLocale]}
Expand Down

0 comments on commit 1fa31c5

Please sign in to comment.