Commit a473e16
authored
fix: convert CredentialCreate Expiration to readable date format (#1247)
## High Level Overview of Change
Fix the incorrect date display of the `Expiration` field in
`CredentialCreate` transactions in Simple view.
### Context of Change
The `Expiration` field in `CredentialCreate` transactions was displaying
an incorrect date in the Simple view. The timestamp was being converted
twice - once by `convertRippleDate()` and then multiplied by
`MILLIS_PER_SECOND` again, resulting in an incorrect date far in the
future (e.g., `February 19, 58731 at 7:40:00 PM`). This change removes
the unnecessary multiplication to display the correct expiration date
(e.g., `October 5, 2026 at 1:53:30 PM`).
### Type of Change
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] Refactor (non-breaking change that only restructures code)
- [x] Tests (You added tests for code that already exists, or your new
feature included in this PR)
- [ ] Documentation Updates
- [ ] Translation Updates
- [ ] Release
## Before / After
#### Before - CredentialCreate Expiration Display
Expiration: February 19, 58731 at 7:40:00 PM
<img width="1049" height="669" alt="before"
src="https://github.com/user-attachments/assets/b2a69d5c-db7f-425e-a38a-6ee0a15cd916"
/>
#### After - CredentialCreate Expiration Display
Expiration: October 5, 2026 at 1:53:30 PM
<img width="1025" height="668" alt="after"
src="https://github.com/user-attachments/assets/8102d73d-34bf-4789-9089-818a282b5bfc"
/>
## Test Plan
- [x] **Unit Tests**
- [x] **Manual Tests**
1. `npm run build && npm start`
2. Visit transaction detail page for CredentialCreate transactions with
Expiration field and confirm that the date displays correctly in Simple
view1 parent 8f5d4ea commit a473e16
File tree
4 files changed
+57
-57
lines changed4 files changed
+57
-57
lines changedLines changed: 2 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
| 8 | + | |
12 | 9 | | |
13 | 10 | | |
14 | 11 | | |
| |||
37 | 34 | | |
38 | 35 | | |
39 | 36 | | |
40 | | - | |
| 37 | + | |
41 | 38 | | |
42 | 39 | | |
43 | 40 | | |
| |||
src/containers/shared/components/Transaction/CredentialCreate/test/CredentialCreateSimple.test.tsx
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
16 | 19 | | |
17 | | - | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| |||
src/containers/shared/components/Transaction/CredentialCreate/test/mock_data/CredentialCreate.json
Lines changed: 47 additions & 47 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
9 | 29 | | |
10 | 30 | | |
11 | 31 | | |
12 | | - | |
| 32 | + | |
13 | 33 | | |
14 | | - | |
15 | | - | |
| 34 | + | |
| 35 | + | |
16 | 36 | | |
17 | 37 | | |
18 | 38 | | |
19 | 39 | | |
20 | 40 | | |
21 | 41 | | |
22 | | - | |
| 42 | + | |
23 | 43 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
28 | 48 | | |
29 | 49 | | |
30 | 50 | | |
31 | 51 | | |
32 | 52 | | |
33 | 53 | | |
34 | | - | |
| 54 | + | |
35 | 55 | | |
36 | | - | |
37 | | - | |
| 56 | + | |
| 57 | + | |
38 | 58 | | |
39 | 59 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | | - | |
68 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
69 | 70 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
74 | 75 | | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
0 commit comments