Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove timezone restriction to show time in chat #7895

Merged
Changes from 1 commit
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
4 changes: 1 addition & 3 deletions src/libs/reportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import _ from 'underscore';
import Str from 'expensify-common/lib/str';
import lodashGet from 'lodash/get';
import Onyx from 'react-native-onyx';
import moment from 'moment';
import ONYXKEYS from '../ONYXKEYS';
import CONST from '../CONST';

Expand Down Expand Up @@ -226,8 +225,7 @@ function canShowReportRecipientLocalTime(personalDetails, myPersonalDetails, rep
&& reportRecipient
&& reportRecipientTimezone
&& currentUserTimezone.selected
Copy link
Member

Choose a reason for hiding this comment

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

Do we need this anymore?

Copy link
Member

Choose a reason for hiding this comment

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

We can also remove this ONYXKEYS.MY_PERSONAL_DETAILS is not needed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We need those to ensure reportRecipient && reportRecipientTimezone are available to show the time. The result of this also used to change styles.

Screenshot 2022-02-25 at 12 56 19 PM

currentUserTimezone.selected can be removed.

What do you say?

Copy link
Member

Choose a reason for hiding this comment

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

So you should remove it. Please clean up extra things.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Need to remove currentUserTimezone.selected this alone right? @parasharrajat

Copy link
Member

Choose a reason for hiding this comment

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

You said this can be removed so please remove it. And try to see what can be cleaned up in the code related to this. I think this ONYXKEYS.MY_PERSONAL_DETAILS is also unused now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes will remove the unused code related to those!

&& reportRecipientTimezone.selected
&& moment().tz(currentUserTimezone.selected).utcOffset() !== moment().tz(reportRecipientTimezone.selected).utcOffset();
&& reportRecipientTimezone.selected;
}

/**
Expand Down