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

Next payment date localization efforts #3195

Draft
wants to merge 6 commits into
base: dev
Choose a base branch
from

Conversation

andrewlimaza
Copy link
Contributor

@andrewlimaza andrewlimaza commented Nov 12, 2024

  • ENHANCEMENT: Adjusted the format_subscription_date to be translatable and reworked the logic to support this.

Needs more thorough testing to ensure it's working as is.

Q: Should we ucfirst the returned string in cases like this when the date format is F j,Y, this won't affect any date formats that start with numbers etc.

Example of a fix.
Screenshot 2024-11-12 at 11 10 26

Steps I took to test that it still does what it says:

  1. Checkout for a recurring membership level so we have the "Next Payment Date" on the site.
  2. You can now test it in a non-English language to ensure translations are working correctly.
  3. To ensure local time is returned and not an incorrect time, I set my site time to something like UTC - 7 (GMT and UTC are in the same timezone).
  4. Set the format to a custom one like Y-m-d H:i:s (so we can see the actual time).
  5. View your membership account page it should show the "Next Payment Date" in local time correctly ( UTC - 7)
  6. To test GMT return times, comment out the conditional for "local_time" so it does not return here.
  7. Refresh the account page and notice that the dates are different.

@andrewlimaza andrewlimaza changed the title Next payment date i18n Next payment date localization efforts Nov 25, 2024
@dparker1005 dparker1005 added this to the 3.4 milestone Dec 17, 2024
Copy link
Member

@dparker1005 dparker1005 left a comment

Choose a reason for hiding this comment

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

The key change here in practice is the default settings for the format_subscription_date() function (requesting a timezone in local time) will not return the same value. With the new PR, any request for timestamp will ALWAYS be in GMT/UTC. I don't think this should cause any issues with existing code, but something that is important to note

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