diff --git a/frontend/src/app/app.module.ts b/frontend/src/app/app.module.ts index f9d5d9474..50bbd88b9 100644 --- a/frontend/src/app/app.module.ts +++ b/frontend/src/app/app.module.ts @@ -27,6 +27,7 @@ import { ShortenStringPipe } from './shared/pipes/shorten-string-pipe/shorten-st import { CapAddressPipe } from './shared/pipes/cap-address-pipe/cap-address-pipe'; import { AppPreloadingStrategy } from './app.preloading-strategy'; import { ServicesApiServices } from './services/services-api.service'; +import { DatePipe } from '@angular/common'; const providers = [ ElectrsApiService, @@ -45,6 +46,7 @@ const providers = [ FiatShortenerPipe, FiatCurrencyPipe, CapAddressPipe, + DatePipe, AppPreloadingStrategy, ServicesApiServices, PreloadService, diff --git a/frontend/src/app/components/acceleration/accelerations-list/accelerations-list.component.html b/frontend/src/app/components/acceleration/accelerations-list/accelerations-list.component.html index 578263789..df915c286 100644 --- a/frontend/src/app/components/acceleration/accelerations-list/accelerations-list.component.html +++ b/frontend/src/app/components/acceleration/accelerations-list/accelerations-list.component.html @@ -35,7 +35,7 @@ {{ (acceleration.feeDelta) | number }} sat - + @@ -55,7 +55,7 @@ Failed 🔄 - + diff --git a/frontend/src/app/components/address-transactions-widget/address-transactions-widget.component.html b/frontend/src/app/components/address-transactions-widget/address-transactions-widget.component.html index 13fe5b0d3..c1c999d6f 100644 --- a/frontend/src/app/components/address-transactions-widget/address-transactions-widget.component.html +++ b/frontend/src/app/components/address-transactions-widget/address-transactions-widget.component.html @@ -14,7 +14,7 @@ - +
 
diff --git a/frontend/src/app/components/custom-dashboard/custom-dashboard.component.html b/frontend/src/app/components/custom-dashboard/custom-dashboard.component.html index 6e2db2165..bf72aab69 100644 --- a/frontend/src/app/components/custom-dashboard/custom-dashboard.component.html +++ b/frontend/src/app/components/custom-dashboard/custom-dashboard.component.html @@ -158,7 +158,7 @@ {{ block.height }} - + {{ block.tx_count | number }}
diff --git a/frontend/src/app/components/difficulty-adjustments-table/difficulty-adjustments-table.component.html b/frontend/src/app/components/difficulty-adjustments-table/difficulty-adjustments-table.component.html index 569fcb188..bf480289b 100644 --- a/frontend/src/app/components/difficulty-adjustments-table/difficulty-adjustments-table.component.html +++ b/frontend/src/app/components/difficulty-adjustments-table/difficulty-adjustments-table.component.html @@ -14,7 +14,7 @@ {{ diffChange.height }} - + {{ diffChange.difficultyShorten }} diff --git a/frontend/src/app/components/liquid-reserves-audit/federation-utxos-list/federation-utxos-list.component.html b/frontend/src/app/components/liquid-reserves-audit/federation-utxos-list/federation-utxos-list.component.html index c9c7bd86b..45118e804 100644 --- a/frontend/src/app/components/liquid-reserves-audit/federation-utxos-list/federation-utxos-list.component.html +++ b/frontend/src/app/components/liquid-reserves-audit/federation-utxos-list/federation-utxos-list.component.html @@ -26,7 +26,7 @@ - + diff --git a/frontend/src/app/components/liquid-reserves-audit/recent-pegs-list/recent-pegs-list.component.html b/frontend/src/app/components/liquid-reserves-audit/recent-pegs-list/recent-pegs-list.component.html index ac9953b4a..b21d83b4e 100644 --- a/frontend/src/app/components/liquid-reserves-audit/recent-pegs-list/recent-pegs-list.component.html +++ b/frontend/src/app/components/liquid-reserves-audit/recent-pegs-list/recent-pegs-list.component.html @@ -31,7 +31,7 @@ - + diff --git a/frontend/src/app/components/pool/pool.component.html b/frontend/src/app/components/pool/pool.component.html index 8ecb68bc9..a446b552b 100644 --- a/frontend/src/app/components/pool/pool.component.html +++ b/frontend/src/app/components/pool/pool.component.html @@ -197,7 +197,7 @@ ‎{{ block.timestamp * 1000 | date:'yyyy-MM-dd HH:mm:ss' }} - + diff --git a/frontend/src/app/components/rbf-list/rbf-list.component.html b/frontend/src/app/components/rbf-list/rbf-list.component.html index 78815544c..133cdfe33 100644 --- a/frontend/src/app/components/rbf-list/rbf-list.component.html +++ b/frontend/src/app/components/rbf-list/rbf-list.component.html @@ -23,7 +23,7 @@ Mined Full RBF - +

diff --git a/frontend/src/app/components/time/time.component.html b/frontend/src/app/components/time/time.component.html new file mode 100644 index 000000000..d859a16a7 --- /dev/null +++ b/frontend/src/app/components/time/time.component.html @@ -0,0 +1 @@ +{{ text }} \ No newline at end of file diff --git a/frontend/src/app/components/time/time.component.ts b/frontend/src/app/components/time/time.component.ts index 6ed3d8cf6..376786d00 100644 --- a/frontend/src/app/components/time/time.component.ts +++ b/frontend/src/app/components/time/time.component.ts @@ -1,15 +1,17 @@ import { Component, OnInit, OnDestroy, ChangeDetectionStrategy, Input, ChangeDetectorRef, OnChanges } from '@angular/core'; import { StateService } from '../../services/state.service'; import { dates } from '../../shared/i18n/dates'; +import { DatePipe } from '@angular/common'; @Component({ selector: 'app-time', - template: `{{ text }}`, + templateUrl: './time.component.html', changeDetection: ChangeDetectionStrategy.OnPush }) export class TimeComponent implements OnInit, OnChanges, OnDestroy { interval: number; text: string; + tooltip: string; precisionThresholds = { year: 100, month: 18, @@ -26,6 +28,7 @@ export class TimeComponent implements OnInit, OnChanges, OnDestroy { @Input() kind: 'plain' | 'since' | 'until' | 'span' | 'before' | 'within' = 'plain'; @Input() fastRender = false; @Input() fixedRender = false; + @Input() showTooltip = false; @Input() relative = false; @Input() precision: number = 0; @Input() numUnits: number = 1; @@ -36,6 +39,7 @@ export class TimeComponent implements OnInit, OnChanges, OnDestroy { constructor( private ref: ChangeDetectorRef, private stateService: StateService, + private datePipe: DatePipe, ) { this.intervals = { year: 31536000, @@ -78,13 +82,20 @@ export class TimeComponent implements OnInit, OnChanges, OnDestroy { switch (this.kind) { case 'since': seconds = Math.floor((+new Date() - +new Date(this.dateString || this.time * 1000)) / 1000); + this.tooltip = this.datePipe.transform(new Date(this.dateString || this.time * 1000), 'yyyy-MM-dd HH:mm'); break; case 'until': case 'within': seconds = (+new Date(this.time) - +new Date()) / 1000; + this.tooltip = this.datePipe.transform(new Date(this.time), 'yyyy-MM-dd HH:mm'); break; default: seconds = Math.floor(this.time); + this.tooltip = ''; + } + + if (!this.showTooltip || this.relative) { + this.tooltip = ''; } if (seconds < 1 && this.kind === 'span') { diff --git a/frontend/src/app/components/tracker/tracker.component.html b/frontend/src/app/components/tracker/tracker.component.html index 81188eaf9..1d1399a07 100644 --- a/frontend/src/app/components/tracker/tracker.component.html +++ b/frontend/src/app/components/tracker/tracker.component.html @@ -59,7 +59,7 @@
First seen
@if (transactionTime > 0) { - + } @else { } @@ -86,7 +86,7 @@
‎{{ tx.status.block_time * 1000 | date:'yyyy-MM-dd HH:mm' }}
- () + ()
diff --git a/frontend/src/app/components/transaction/transaction.component.html b/frontend/src/app/components/transaction/transaction.component.html index 344d24dc9..a09e16d6b 100644 --- a/frontend/src/app/components/transaction/transaction.component.html +++ b/frontend/src/app/components/transaction/transaction.component.html @@ -450,7 +450,7 @@ @if (transactionTime > 0) { Confirmed - + } } @else { @@ -464,7 +464,7 @@ } @else if (transactionTime > 0) { First seen - + } @else { diff --git a/frontend/src/app/components/transactions-list/transactions-list.component.html b/frontend/src/app/components/transactions-list/transactions-list.component.html index 1b3cc82eb..48e53a10d 100644 --- a/frontend/src/app/components/transactions-list/transactions-list.component.html +++ b/frontend/src/app/components/transactions-list/transactions-list.component.html @@ -8,7 +8,7 @@
‎{{ tx.status.block_time * 1000 | date:'yyyy-MM-dd HH:mm' }} - +
diff --git a/frontend/src/app/dashboard/dashboard.component.html b/frontend/src/app/dashboard/dashboard.component.html index 1b3eef543..7c84351ca 100644 --- a/frontend/src/app/dashboard/dashboard.component.html +++ b/frontend/src/app/dashboard/dashboard.component.html @@ -110,7 +110,7 @@ {{ block.height }} - + {{ block.tx_count | number }}