frontend: add received date to coin control UTXO list
Add the received date (block header timestamp) to the UTXO detail in the coin control view. This makes it easier for users to view the date, which can be helpful for various reasons, without having to open each UTXO individually in the block explorer.
@benma @thisconnect @Beerosagos I updated the PR:
- removed
GetHeaderTimestampfunction and getting theHeaderTimestampinSpendableOutputs - created
TimeStampmethod in theTransactionDataand refactored theTimeStampfield toHeaderTimestamp - I'm not sure if the formatting with RFC3339 is necessary, isn't that done automatically in time package ? https://pkg.go.dev/time#Time.MarshalJSON
- updated the formatting of the date to use
parseTimeShort
PTAL :pray:
I'm not sure if the formatting with RFC3339 is necessary, isn't that done automatically in time package ? https://pkg.go.dev/time#Time.MarshalJSON
Imo it would be good to format it explicitly for consistency.
Now sure if there is a nice way to add a test for SpendableOutput.HeaderTimestamp, maybe in transactions_test.go:TestSpendableOutputs? cc @benma
It would be nice to move the logic outside of handlers.go, but since this PR has been opened for a while, I'd do it in a separate one.
@Beerosagos
- added RFC3339 formatting
- removed fallback to
CreatedTimestamp - reverted the refactor of
TransactionDataand removed the new Timestamp function (can be added in a separate PR if needed) - added a new Pending badge for unconfirmed transactions or when the blockchain is not yet synced
PTAL
Backend LGTM! For the frontend, I meant just a text label, for Pending, not a badge. But I'll leave the last word to @thisconnect on this :innocent:
Backend LGTM! For the frontend, I meant just a text label, for Pending, not a badge. But I'll leave the last word to @thisconnect on this 😇
we can always add a badge later if it makes sense.
@Beerosagos @thisconnect
I removed the badge from "Pending", please check.
@benma I've updated to reuse existing strings, please check.