match higher precision time in block page details

This commit is contained in:
Mononaut 2023-07-05 11:02:32 -04:00
parent 850752e0ea
commit cc695dc910
No known key found for this signature in database
GPG Key ID: A3F058E41374C04E
3 changed files with 4 additions and 2 deletions

View File

@ -41,7 +41,7 @@
<tr> <tr>
<td i18n="block.timestamp">Timestamp</td> <td i18n="block.timestamp">Timestamp</td>
<td> <td>
<app-timestamp [unixTime]="block.timestamp"></app-timestamp> <app-timestamp [unixTime]="block.timestamp" [precision]="1" minUnit="minute"></app-timestamp>
</td> </td>
</tr> </tr>
<tr> <tr>

View File

@ -2,6 +2,6 @@
<span *ngIf="seconds !== undefined"> <span *ngIf="seconds !== undefined">
&lrm;{{ seconds * 1000 | date: customFormat ?? 'yyyy-MM-dd HH:mm' }} &lrm;{{ seconds * 1000 | date: customFormat ?? 'yyyy-MM-dd HH:mm' }}
<div class="lg-inline" *ngIf="!hideTimeSince"> <div class="lg-inline" *ngIf="!hideTimeSince">
<i class="symbol">(<app-time kind="since" [time]="seconds" [fastRender]="true"></app-time>)</i> <i class="symbol">(<app-time kind="since" [time]="seconds" [fastRender]="true" [precision]="precision" [minUnit]="minUnit"></app-time>)</i>
</div> </div>
</span> </span>

View File

@ -11,6 +11,8 @@ export class TimestampComponent implements OnChanges {
@Input() dateString: string; @Input() dateString: string;
@Input() customFormat: string; @Input() customFormat: string;
@Input() hideTimeSince: boolean = false; @Input() hideTimeSince: boolean = false;
@Input() precision: number = 0;
@Input() minUnit: 'year' | 'month' | 'week' | 'day' | 'hour' | 'minute' | 'second' = 'second';
seconds: number | undefined = undefined; seconds: number | undefined = undefined;