Automattic / woocommerce-payments

Accept payments via credit card. Manage transactions within WordPress.
https://wordpress.org/plugins/woocommerce-payments/
Other
174 stars 69 forks source link

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

Open brucealdridge opened 1 year ago

brucealdridge commented 1 year ago

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:

https://github.com/Automattic/woocommerce-payments/blob/23b58e9ea093f9fd001c761abfda30bc13234a81/client/disputes/index.tsx#L204-L207

https://github.com/Automattic/woocommerce-payments/blob/23b58e9ea093f9fd001c761abfda30bc13234a81/client/disputes/index.tsx#L213-L216

rossviviano commented 12 months ago

7293502-zen

brucealdridge commented 1 week ago

@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 commented 1 week ago

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