Skip to content

Commit

Permalink
Adds code to fix changing locale on the fly
Browse files Browse the repository at this point in the history
  • Loading branch information
anthony0030 committed Jun 20, 2024
1 parent a107c81 commit cdbc5b0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-live-clock",
"version": "6.1.22",
"version": "6.1.23-beta",
"description": "React Live Clock",
"main": "lib/index.js",
"types": "index.d.ts",
Expand Down
6 changes: 5 additions & 1 deletion src/Component.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import React, {useState, useEffect} from 'react';
import PropTypes from 'prop-types';
import Moment from 'react-moment';
import 'moment-timezone';
import momentTimezone from 'moment-timezone';

export default function ReactLiveClock(props) {
const {
Expand Down Expand Up @@ -39,6 +39,10 @@ export default function ReactLiveClock(props) {
}


useEffect(() => {
momentTimezone.locale('locale');
}, [locale]);

useEffect(() => {
if (noSsr && document) {
setNoSsr(false);
Expand Down

0 comments on commit cdbc5b0

Please sign in to comment.