Skip to content

Commit 30a58f6

Browse files
fix(time-select): show time in user's time zone
1 parent 882918f commit 30a58f6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

components/time-select/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import useTranslation from 'next-translate/useTranslation';
1515
import { TCallback } from 'lib/model/callback';
1616
import { Timeslot } from 'lib/model/timeslot';
1717
import { useClickContext } from 'lib/hooks/click-outside';
18+
import { useUser } from 'lib/context/user';
1819

1920
import SelectSurface from './select-surface';
2021
import styles from './time-select.module.scss';
@@ -65,6 +66,7 @@ function TimeSelect({
6566
const [menuOpen, setMenuOpen] = useState<boolean>(false);
6667
const timeoutId = useRef<ReturnType<typeof setTimeout>>();
6768

69+
const { user } = useUser();
6870
const { lang: locale } = useTranslation();
6971
const { updateEl, removeEl } = useClickContext();
7072

@@ -100,7 +102,7 @@ function TimeSelect({
100102
readOnly
101103
textarea={false}
102104
inputRef={inputRef}
103-
value={value?.toString(locale) || ''}
105+
value={value?.toString(locale, user.timezone) || ''}
104106
className={styles.field}
105107
onFocus={() => {
106108
if (onFocused) onFocused();

0 commit comments

Comments
 (0)