Skip to content

Commit

Permalink
feat: onboarding auto fetch timezone (#1488)
Browse files Browse the repository at this point in the history
Co-authored-by: Brian Douglas <[email protected]>
  • Loading branch information
diivi and bdougie authored Aug 7, 2023
1 parent 67662b2 commit ae5cdd7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pages/start.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,14 @@ const LoginStep3: React.FC<LoginStep3Props> = ({ interests, user }) => {
const [timezone, setTimezone] = useState("");
const [loading, setLoading] = useState(false);

useEffect(() => {
const userTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
const timezone = timezones.find((timezone) => timezone.utc.includes(userTimezone));
if (timezone) {
setTimezone(timezone.value);
}
}, []);

const handleUpdateTimezone = async () => {
setLoading(true);
try {
Expand Down

0 comments on commit ae5cdd7

Please sign in to comment.