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

User set Date and Time formatting aren't respected in react components #6567

Closed
brucealdridge opened this issue Jun 22, 2023 · 4 comments · Fixed by #9635, #9638 or #9640
Closed

User set Date and Time formatting aren't respected in react components #6567

brucealdridge opened this issue Jun 22, 2023 · 4 comments · Fixed by #9635, #9638 or #9640
Assignees
Labels
category: core WC Payments core related issues, where it’s obvious. focus: misc or unknown Issues that need to be added to a focus area (aka "needs focus"). focus: reporting good first issue The issue is a good candidate for the first community contribution/for a newcomer to the team. status: blocked The issue is blocked from progressing, waiting for another piece of work to be done. type: bug The issue is a confirmed bug.

Comments

@brucealdridge
Copy link
Contributor

Describe the bug

Date and time formats are user settable in WordPress. WCPay components do not use these settings instead opting to hardcode formats.

To Reproduce

  1. Go to 'Settings' > 'General'
  2. Change a date time format that is not the default.
  3. Visit a page with react components such as Transactions
  4. See dates and time format is not used.

NB: This also applies to Deposits, Disputes, Loans, and more.

Actual behavior

Date and time formats are hardcoded inside react components across WCPay. User settings are not respected.

Screenshots

Screenshot 2023-06-22 at 2 52 03 PM
Screenshot 2023-06-22 at 2 51 40 PM

Expected behavior

User set date/time formats should be used wherever possible

Sample Snippets:

dateI18n(
'M j, Y',
moment( dispute.created ).toISOString()
)

dateI18n(
'M j, Y / g:iA',
moment.utc( dispute.due_by ).local().toISOString()
)

@brucealdridge brucealdridge added the type: bug The issue is a confirmed bug. label Jun 22, 2023
@zmaglica zmaglica added category: core WC Payments core related issues, where it’s obvious. good first issue The issue is a good candidate for the first community contribution/for a newcomer to the team. labels Jun 26, 2023
@rossviviano
Copy link

7293502-zen

@haszari haszari added the focus: misc or unknown Issues that need to be added to a focus area (aka "needs focus"). label Mar 11, 2024
@mgascam mgascam self-assigned this Oct 23, 2024
@mgascam mgascam linked a pull request Oct 28, 2024 that will close this issue
6 tasks
@brucealdridge
Copy link
Contributor Author

@mgascam, I'm not sure you meant to close this issue with #9640. It looks like that PR just alters some tests, whereas I believe this issue will require code changes in addition to test changes.

@mgascam
Copy link
Contributor

mgascam commented Oct 29, 2024

Thanks @brucealdridge, you are right, this was closed by mistake. Reopening.

@mgascam
Copy link
Contributor

mgascam commented Nov 8, 2024

We’re pausing work on this issue until the design proposal discussed in this thread is available for review.

@mgascam mgascam added the status: blocked The issue is blocked from progressing, waiting for another piece of work to be done. label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: core WC Payments core related issues, where it’s obvious. focus: misc or unknown Issues that need to be added to a focus area (aka "needs focus"). focus: reporting good first issue The issue is a good candidate for the first community contribution/for a newcomer to the team. status: blocked The issue is blocked from progressing, waiting for another piece of work to be done. type: bug The issue is a confirmed bug.
Projects
None yet
7 participants