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

#5664 Pull email's received time directly on Gmail #5676

Merged
merged 32 commits into from
May 17, 2024

Conversation

martgil
Copy link
Collaborator

@martgil martgil commented Apr 13, 2024

The goal of this PR is to pull the exact time an email was received from Gmail. This also resolves issues with accurately retrieving the time, whether it's in a 12 or 24-hour format, since it's already provided within the pulled data from Gmail.

close #5664

Screenshots:
Opening the same email using different time format

12 hour format:

image
image

24 hour format:

image
image

To change time format in Gmail:

1.) Go to Gmail Settings -> See all settings.
2.) Change language from 'English US' to 'English UK'.
3.) Save and open the desired email.


Tests (delete all except exactly one):

  • Tests added or updated

To be filled by reviewers

I have reviewed that this PR... (tick whichever items you personally focused on during this review):

  • addresses the issue it closes (if any)
  • code is readable and understandable
  • is accompanied with tests, or tests are not needed
  • is free of vulnerabilities
  • is documented clearly and usefully, or doesn't need documentation

@martgil martgil requested a review from sosnovsky as a code owner April 13, 2024 07:46
@martgil
Copy link
Collaborator Author

martgil commented Apr 13, 2024

Hi @sosnovsky, I hope you're doing well. I'd like to check if you have any preferences regarding the date and time format, or if the one proposed in this PR is sufficient?

@martgil martgil marked this pull request as draft April 25, 2024 06:02
@martgil martgil marked this pull request as ready for review April 26, 2024 08:52
@martgil martgil requested a review from sosnovsky April 26, 2024 08:52
@martgil martgil marked this pull request as draft April 26, 2024 09:53
@martgil
Copy link
Collaborator Author

martgil commented Apr 26, 2024

Hi @sosnovsky I have re-run the test but the failing one is not related to my PR. This should be good to go.

@martgil martgil requested a review from sosnovsky April 26, 2024 11:49
@martgil martgil marked this pull request as ready for review April 26, 2024 11:50
extension/js/common/core/common.ts Outdated Show resolved Hide resolved
extension/js/common/message-renderer.ts Outdated Show resolved Hide resolved
@martgil
Copy link
Collaborator Author

martgil commented May 8, 2024

Hi @sosnovsky does this look good to you? I also plan to share a build coming from this PR to double-check if the user would get his desired date and time when print-previewing email -- it should work fine.

@martgil martgil requested a review from sosnovsky May 10, 2024 12:59
Copy link
Collaborator

@sosnovsky sosnovsky left a comment

Choose a reason for hiding this comment

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

Looks good now, you can send test build to reporter for checking

test/source/tests/decrypt.ts Outdated Show resolved Hide resolved
@martgil
Copy link
Collaborator Author

martgil commented May 15, 2024

Looks good now, you can send test build to reporter for checking

Thanks, @sosnovsky. I've informed him, but still haven't heard their feedback. I'll update you as soon as I have it.

@sosnovsky sosnovsky merged commit bcb6d72 into master May 17, 2024
14 checks passed
@sosnovsky sosnovsky deleted the issue-5664-pull-recevied-email-time-from-gmail branch May 17, 2024 11:41
@sosnovsky
Copy link
Collaborator

@martgil I merged this PR, to include it in the upcoming release.

ioanmo226 pushed a commit that referenced this pull request May 27, 2024
* Pull email's received time directly on Gmail

* update common.ts's fromDate function

* fix failing test

* revert changes

* revert changes on common.ts

* Use Gmail's received date cautiously, with the header date as a fallback

* add proper date validity checking

* revert changes

* revert changes

* Ensure the retrieval of the received date on Gmail is fail-safe

* detect gmail timezone and use simple yyyy-dd-mm format used in toISOString()

* add comments

* code simplification

* Unset user's date locale

* use UTC Timezones

* Fix correct time

* revert changes

* determine date/time based on Gmail settings

* revert changes

* update tests

* apply simplification

* update test

* fix test

* update test

* removed unnecessary tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Time in print-preview does not follow/match the time format from Gmail
2 participants