Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web/core/components/global/timezone-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const TimezoneSelect: FC<TTimezoneSelect> = observer((props) => {
<div>
<CustomSearchSelect
value={value}
label={selectedValue ? selectedValue(value) : label}
label={value && selectedValue ? selectedValue(value) : label}
options={isDisabled || disabled ? [] : timezones}
onChange={onChange}
buttonClassName={cn(buttonClassName, {
Expand Down
2 changes: 1 addition & 1 deletion web/core/components/profile/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const ProfileForm = observer((props: TProfileFormProps) => {
email: user.email || "",
role: profile.role || "Product / Project Manager",
language: profile.language || "en",
user_timezone: "Asia/Kolkata",
user_timezone: user.user_timezone || "Asia/Kolkata",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consider removing the hardcoded timezone fallback.

While using user.user_timezone is a good improvement, having "Asia/Kolkata" as a fallback still introduces a default timezone. Consider using the browser's timezone as a fallback instead.

-user_timezone: user.user_timezone || "Asia/Kolkata",
+user_timezone: user.user_timezone || Intl.DateTimeFormat().resolvedOptions().timeZone,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
user_timezone: user.user_timezone || "Asia/Kolkata",
user_timezone: user.user_timezone || Intl.DateTimeFormat().resolvedOptions().timeZone,

},
});
// derived values
Expand Down
Loading