diff --git a/cypress/snapshots/html/snapshot.html b/cypress/snapshots/html/snapshot.html index 84773d778..77c9b9700 100644 --- a/cypress/snapshots/html/snapshot.html +++ b/cypress/snapshots/html/snapshot.html @@ -1,440 +1,440 @@ -
TimeDescriptionAmount
11/07/24Block Reward4.00 PIV +
TimeDescriptionAmount
Nov 7Block Reward4.00 PIV -
11/07/24Sent to DJYKS3...780 PIV +
Nov 7Sent to DJYKS3...780 PIV -
11/06/24Delegated to SdgQDp...500 PIV +
Nov 6Delegated to SdgQDp...500 PIV -
11/04/24Sent to D9m8Q9...10.00 PIV +
Nov 4Sent to D9m8Q9...10.00 PIV -
11/04/24Sent to D9m8Q9...5.00 PIV +
Nov 4Sent to D9m8Q9...5.00 PIV -
11/04/24Sent to D9m8Q9...2.00 PIV +
Nov 4Sent to D9m8Q9...2.00 PIV -
11/02/24Block Reward4.00 PIV +
Nov 2Block Reward4.00 PIV -
11/01/24Block Reward4.00 PIV +
Nov 1Block Reward4.00 PIV -
10/31/24Delegated to SdgQDp...500 PIV +
Oct 31Delegated to SdgQDp...500 PIV -
10/31/24Delegated to SdgQDp...500 PIV +
Oct 31Delegated to SdgQDp...500 PIV -
10/31/24Delegated to SdgQDp...500 PIV +
Oct 31Delegated to SdgQDp...500 PIV -
10/31/24Delegated to SdgQDp...500 PIV +
Oct 31Delegated to SdgQDp...500 PIV -
10/31/24Delegated to SdgQDp...500 PIV +
Oct 31Delegated to SdgQDp...500 PIV -
10/31/24Delegated to SdgQDp...500 PIV +
Oct 31Delegated to SdgQDp...500 PIV -
10/29/24Block Reward4,250 PIV +
Oct 29Block Reward4,250 PIV -
10/28/24Sent to D8pLwc...52.83 PIV +
Oct 28Sent to D8pLwc...52.83 PIV -
10/28/24Undelegated100 PIV +
Oct 28Undelegated100 PIV -
10/28/24Block Reward4.00 PIV +
Oct 28Block Reward4.00 PIV -
10/25/24Sent to DDS5v6...575 PIV +
Oct 25Sent to DDS5v6...575 PIV -
10/25/24Undelegated575 PIV +
Oct 25Undelegated575 PIV -
10/24/24Block Reward4.00 PIV +
Oct 24Block Reward4.00 PIV -
10/20/24Block Reward4.00 PIV +
Oct 20Block Reward4.00 PIV -
10/12/24Block Reward4.00 PIV +
Oct 12Block Reward4.00 PIV -
10/11/24Sent to DQHLhj...1,250 PIV +
Oct 11Sent to DQHLhj...1,250 PIV -
10/11/24Undelegated1,250 PIV +
Oct 11Undelegated1,250 PIV -
10/11/24Received with DLabsk...0.10 PIV +
Oct 11Received with DLabsk...0.10 PIV -
10/08/24Block Reward4.00 PIV +
Oct 8Block Reward4.00 PIV -
10/05/24Block Reward4.00 PIV +
Oct 5Block Reward4.00 PIV -
10/04/24Sent to DLh3sF...485 PIV +
Oct 4Sent to DLh3sF...485 PIV -
10/04/24Sent to DB4AWX...1.00 PIV +
Oct 4Sent to DB4AWX...1.00 PIV -
10/03/24Sent to DPFMBW...264 PIV +
Oct 3Sent to DPFMBW...264 PIV -
10/03/24Undelegated500 PIV +
Oct 3Undelegated500 PIV -
10/03/24Undelegated250 PIV +
Oct 3Undelegated250 PIV -
10/02/24Delegated to SdgQDp...4,250 PIV +
Oct 2Delegated to SdgQDp...4,250 PIV -
09/30/24Sent to self0.01 PIV +
Sep 30Sent to self0.01 PIV -
09/28/24Block Reward4,250 PIV +
Sep 28Block Reward4,250 PIV -
09/19/24Sent to DHYYDV...747 PIV +
Sep 19Sent to DHYYDV...747 PIV -
09/15/24Sent to DQzW1G...100 PIV +
Sep 15Sent to DQzW1G...100 PIV -
09/06/24Sent to D6robL...300 PIV +
Sep 6Sent to D6robL...300 PIV -
09/05/24Sent to D5WAwQ...1,500 PIV +
Sep 5Sent to D5WAwQ...1,500 PIV -
09/05/24Undelegated2,646 PIV +
Sep 5Undelegated2,646 PIV -
09/04/24Sent to DEsey2...3,500 PIV +
Sep 4Sent to DEsey2...3,500 PIV -
09/04/24Undelegated3,501 PIV +
Sep 4Undelegated3,501 PIV -
09/03/24Sent to DHprhh...106 PIV +
Sep 3Sent to DHprhh...106 PIV -
09/03/24Undelegated106 PIV +
Sep 3Undelegated106 PIV -
09/03/24Sent to DHprhh...101 PIV +
Sep 3Sent to DHprhh...101 PIV -
09/03/24Undelegated101 PIV +
Sep 3Undelegated101 PIV -
09/02/24Sent to DPf384...100 PIV +
Sep 2Sent to DPf384...100 PIV -
09/02/24Undelegated100 PIV +
Sep 2Undelegated100 PIV -
09/02/24Sent to DLAoq6...1,050 PIV +
Sep 2Sent to DLAoq6...1,050 PIV -
09/02/24Undelegated1,050 PIV +
Sep 2Undelegated1,050 PIV -
09/02/24Block Reward4.00 PIV +
Sep 2Block Reward4.00 PIV -
09/01/24Delegated to SdgQDp...7,500 PIV +
Sep 1Delegated to SdgQDp...7,500 PIV -
08/29/24Sent to DP7Vf5...700 PIV +
Aug 29Sent to DP7Vf5...700 PIV -
08/29/24Sent to D9AbTj...1,500 PIV +
Aug 29Sent to D9AbTj...1,500 PIV -
08/29/24Block Reward7,500 PIV +
Aug 29Block Reward7,500 PIV -
08/29/24Block Reward2,200 PIV +
Aug 29Block Reward2,200 PIV -
08/14/24Sent to DQzW1G...150 PIV +
Aug 14Sent to DQzW1G...150 PIV -
08/09/24Sent to DLNq1j...700 PIV +
Aug 9Sent to DLNq1j...700 PIV -
08/03/24Sent to D8Frux...1,100 PIV +
Aug 3Sent to D8Frux...1,100 PIV -
08/03/24Undelegated1,000 PIV +
Aug 3Undelegated1,000 PIV -
07/29/24Sent to DQHajg...6,240 PIV +
Jul 29Sent to DQHajg...6,240 PIV -
07/29/24Sent to DQHajg...10.00 PIV +
Jul 29Sent to DQHajg...10.00 PIV -
07/29/24Delegated to SdgQDp...500 PIV +
Jul 29Delegated to SdgQDp...500 PIV -
07/29/24Delegated to SdgQDp...500 PIV +
Jul 29Delegated to SdgQDp...500 PIV -
07/29/24Sent to DQzW1G...1,000 PIV +
Jul 29Sent to DQzW1G...1,000 PIV -
07/29/24Sent to D7joLL...11,750 PIV +
Jul 29Sent to D7joLL...11,750 PIV -
07/29/24Block Reward6,250 PIV +
Jul 29Block Reward6,250 PIV -
07/29/24Block Reward12,500 PIV +
Jul 29Block Reward12,500 PIV -
07/29/24Block Reward2,200 PIV +
Jul 29Block Reward2,200 PIV -
07/23/24Sent to DURpVc...203 PIV +
Jul 23Sent to DURpVc...203 PIV -
07/23/24Sent to D8Frux...500 PIV +
Jul 23Sent to D8Frux...500 PIV -
07/23/24Undelegated554 PIV +
Jul 23Undelegated554 PIV -
07/21/24Sent to D9HDmW...300 PIV +
Jul 21Sent to D9HDmW...300 PIV -
07/19/24Block Reward4.00 PIV +
Jul 19Block Reward4.00 PIV -
07/18/24Sent to DQzW1G...51.00 PIV +
Jul 18Sent to DQzW1G...51.00 PIV -
07/18/24Undelegated500 PIV +
Jul 18Undelegated500 PIV -
07/14/24Block Reward4.00 PIV +
Jul 14Block Reward4.00 PIV -
07/12/24Sent to DHQvLM...148 PIV +
Jul 12Sent to DHQvLM...148 PIV -
07/11/24Sent to DQzW1G...50.00 PIV +
Jul 11Sent to DQzW1G...50.00 PIV -
07/10/24Sent to DQzW1G...50.00 PIV +
Jul 10Sent to DQzW1G...50.00 PIV -
07/09/24Sent to DJ383G...1,252 PIV +
Jul 9Sent to DJ383G...1,252 PIV -
07/09/24Undelegated1,500 PIV +
Jul 9Undelegated1,500 PIV -
07/09/24Block Reward4.00 PIV +
Jul 9Block Reward4.00 PIV -
07/08/24Block Reward4.00 PIV +
Jul 8Block Reward4.00 PIV -
07/03/24Block Reward4.00 PIV +
Jul 3Block Reward4.00 PIV -
06/30/24Delegated to SdgQDp...2,534 PIV +
Jun 30Delegated to SdgQDp...2,534 PIV -
06/30/24Received with DLabsk...0.25 PIV +
Jun 30Received with DLabsk...0.25 PIV -
06/30/24Received with DLabsk...1.06 PIV +
Jun 30Received with DLabsk...1.06 PIV -
06/28/24Block Reward2,200 PIV +
Jun 28Block Reward2,200 PIV -
06/28/24Received with DLabsk...2.09 PIV +
Jun 28Received with DLabsk...2.09 PIV -
06/28/24Received with DLabsk...1.95 PIV +
Jun 28Received with DLabsk...1.95 PIV -
06/27/24Received with DLabsk...0.49 PIV +
Jun 27Received with DLabsk...0.49 PIV -
06/27/24Received with DLabsk...10.35 PIV +
Jun 27Received with DLabsk...10.35 PIV -
06/27/24Received with DLabsk...0.65 PIV +
Jun 27Received with DLabsk...0.65 PIV -
06/27/24Received with DLabsk...1.06 PIV +
Jun 27Received with DLabsk...1.06 PIV -
06/26/24Received with DLabsk...0.64 PIV +
Jun 26Received with DLabsk...0.64 PIV -
06/26/24Received with DLabsk...0.65 PIV +
Jun 26Received with DLabsk...0.65 PIV -
06/25/24Received with DLabsk...6.27 PIV +
Jun 25Received with DLabsk...6.27 PIV -
06/24/24Received with DLabsk...1.46 PIV +
Jun 24Received with DLabsk...1.46 PIV -
06/24/24Received with DLabsk...0.10 PIV +
Jun 24Received with DLabsk...0.10 PIV -
06/24/24Sent to D9AbTj...21.00 PIV +
Jun 24Sent to D9AbTj...21.00 PIV -
06/24/24Received with DLabsk...0.26 PIV +
Jun 24Received with DLabsk...0.26 PIV -
06/24/24Received with DLabsk...1.29 PIV +
Jun 24Received with DLabsk...1.29 PIV -
06/24/24Received with DLabsk...4.01 PIV +
Jun 24Received with DLabsk...4.01 PIV -
06/24/24Received with DLabsk...0.28 PIV +
Jun 24Received with DLabsk...0.28 PIV -
06/24/24Received with DLabsk...2.15 PIV +
Jun 24Received with DLabsk...2.15 PIV -
06/23/24Received with DLabsk...1.04 PIV +
Jun 23Received with DLabsk...1.04 PIV -
06/22/24Received with DLabsk...2.58 PIV +
Jun 22Received with DLabsk...2.58 PIV -
06/22/24Received with DLabsk...1.28 PIV +
Jun 22Received with DLabsk...1.28 PIV diff --git a/scripts/dashboard/Activity.vue b/scripts/dashboard/Activity.vue index 4a096035a..d62cab7a5 100644 --- a/scripts/dashboard/Activity.vue +++ b/scripts/dashboard/Activity.vue @@ -125,28 +125,47 @@ async function parseTXs(arrTXs) { const newTxs = []; // Prepare time formatting - const dateOptions = { - year: '2-digit', - month: '2-digit', - day: '2-digit', - }; const timeOptions = { hour: '2-digit', minute: '2-digit', hour12: true, }; + const dateOptions = { + month: 'short', + day: 'numeric', + }; + const yearOptions = { + month: 'short', + day: 'numeric', + year: '2-digit', + }; const cDB = await Database.getInstance(); const cAccount = await cDB.getAccount(); + const cDate = new Date(); for (const cTx of arrTXs) { - const dateTime = new Date(cTx.time * 1000); - // If this Tx is older than 24h, then hit the `Date` cache logic, otherwise, use a `Time` and skip it - let strDate = - Date.now() / 1000 - cTx.time > 86400 - ? dateTime.toLocaleDateString(undefined, dateOptions) - : dateTime.toLocaleTimeString(undefined, timeOptions); - if (cTx.blockHeight === -1) { - strDate = 'Pending'; + const cTxDate = new Date(cTx.time * 1000); + + // Unconfirmed Txs are simply 'Pending' + let strDate = 'Pending'; + if (cTx.blockHeight !== -1) { + // Check if it was today (same day, month and year) + const fToday = + cTxDate.getDate() === cDate.getDate() && + cTxDate.getMonth() === cDate.getMonth() && + cTxDate.getFullYear() === cDate.getFullYear(); + + // Figure out the most convenient time display for this Tx + if (fToday) { + // TXs made today are displayed by time (02:13 pm) + strDate = cTxDate.toLocaleTimeString(undefined, timeOptions); + } else if (cTxDate.getFullYear() === cDate.getFullYear()) { + // TXs older than today are displayed by short date (18 Nov) + strDate = cTxDate.toLocaleDateString(undefined, dateOptions); + } else { + // TXs in previous years are displayed by their short date and year (18 Nov 2023) + strDate = cTxDate.toLocaleDateString(undefined, yearOptions); + } } // Coinbase Transactions (rewards) require coinbaseMaturity confs @@ -157,9 +176,6 @@ async function parseTXs(arrTXs) { ? cChainParams.current.coinbaseMaturity : 6); - // Choose the content type, for the Dashboard; use a generative description, otherwise, a TX-ID - // let txContent = props.rewards ? cTx.id : 'Block Reward'; - // Format the amount to reduce text size let formattedAmt = ''; if (cTx.amount < 0.01) {