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

Fix: use the date timestamp with the proper timezone on the donor dashboard #7671

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

glaubersilva
Copy link
Contributor

@glaubersilva glaubersilva commented Jan 9, 2025

Resolves GIVE-1233

Description

This PR changes how we pass the date to the human_time_diff() function. Instead of using the strtotime() function, we are now using the new Temporal::getDateTimestamp() method that automatically uses the proper timezone to generate the timestamp.

Affects

The donor dashboard.

Visuals

image

Testing Instructions

  1. Create a new donation with a new donor;
  2. Go to the Donor Dashboard with the new user logged in;
  3. Make sure the proper dates are displayed for Last donated {TIME} ago and Donor for {TIME}.

Pre-review Checklist

  • Acceptance criteria satisfied and marked in related issue
  • Relevant @unreleased tags included in DocBlocks
  • Includes unit tests
  • Reviewed by the designer (if follows a design)
  • Self Review of code and UX completed

@glaubersilva glaubersilva self-assigned this Jan 9, 2025
@glaubersilva glaubersilva changed the title Fix: retrieve date with proper time zone Fix: use the date timestamp with the proper timezone Jan 9, 2025
@glaubersilva glaubersilva changed the title Fix: use the date timestamp with the proper timezone Fix: use the date timestamp with the proper timezone on the donor dashboard Jan 9, 2025
@glaubersilva glaubersilva marked this pull request as ready for review January 9, 2025 19:28
@JoshuaHungDinh JoshuaHungDinh self-requested a review January 9, 2025 19:58

return $date->getTimestamp();
} catch (Exception $e) {
return 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Hey what happens if there is an error? Should we add a log or maybe a fallback timestamp?

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.

2 participants