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: display date and time in some vouchers #2618
Conversation
🦋 Changeset detectedLatest commit: 3b2c73c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Size Change: +437 B (0%) Total Size: 1.14 MB
ℹ️ View Unchanged
|
Quality Gate failedFailed conditions |
How did you test that this works with expiration dates/times from different time zones? |
@@ -25,7 +25,7 @@ export default function DragonpayVoucherResult(props: DragonpayVoucherResultProp | |||
surcharge={surcharge && i18n.amount(surcharge.value, surcharge.currency)} | |||
voucherDetails={ | |||
[ | |||
{ label: i18n.get('voucher.expirationDate'), value: i18n.date(expiresAt) }, | |||
{ label: i18n.get('voucher.expirationDate'), value: i18n.dateTime(expiresAt) }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure that the expiresAt
will always be a date & time value? What happens if it's still just a date only?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will always be there since the backend is sending a ISO date. It could be wrong but then it's something on backend/acquiring side.
* fix: display date and time in some vouhcers * fix imports * fix locale issue * adds safety checks (cherry picked from commit 57bacc7)
Summary
For some voucher like Econtext and Dragon pay we shuold display expiration time together with the date.
Created a new i18n function to format dateTime. Also make a tittle change to make sure we are not creating a new formatter every time as it's a slow operation (according MDN).
Tested scenarios
Fixed issue:
COWEB-1297, COWEB-1359