mirror of
https://github.com/block-core/blockcore-notes.git
synced 2024-09-28 22:10:42 +00:00
Made a timestamp to ISO date (#66)
This commit is contained in:
parent
530239245c
commit
a5f5208a89
@ -93,6 +93,7 @@ import { ImportSheet } from './shared/import-sheet/import-sheet';
|
||||
import { EventButtonsComponent } from './shared/event-buttons/event-buttons';
|
||||
import { ContentMusicComponent } from './shared/content-music/content-music';
|
||||
import { MediaPlayerComponent } from './shared/media-player/media-player';
|
||||
import { DateComponent } from './shared/date/date';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
@ -143,6 +144,7 @@ import { MediaPlayerComponent } from './shared/media-player/media-player';
|
||||
EventButtonsComponent,
|
||||
ContentMusicComponent,
|
||||
MediaPlayerComponent,
|
||||
DateComponent
|
||||
],
|
||||
imports: [
|
||||
HttpClientModule,
|
||||
|
@ -42,7 +42,7 @@
|
||||
|
||||
<div class="events above-event clickable" (click)="navigation.openEvent($event, event)" *ngIf="thread.above$ | async as event">
|
||||
<div class="events-header">
|
||||
<app-event-header [pubkey]="event.pubkey"><span class="event-date" [matTooltip]="event.created_at.toString()">{{ event.created_at | ago }}</span> <app-directory-icon [pubkey]="event.pubkey"></app-directory-icon></app-event-header>
|
||||
<app-event-header [pubkey]="event.pubkey"> <app-date [date]="event.created_at"> </app-date> <app-directory-icon [pubkey]="event.pubkey"></app-directory-icon></app-event-header>
|
||||
<app-event-actions [event]="event" [pubkey]="event.pubkey"></app-event-actions>
|
||||
</div>
|
||||
<app-content class="thread-content" [ngClass]="{ 'no-lines': !optionsService.options.showLines, 'lines': optionsService.options.showLines }" [event]="event"></app-content>
|
||||
@ -52,7 +52,7 @@
|
||||
|
||||
<div class="current-event events noclick" *ngIf="thread.event$ | async as event">
|
||||
<div class="events-header">
|
||||
<app-event-header [pubkey]="event.pubkey"><span class="event-date" [matTooltip]="event.created_at.toString()">{{ event.created_at | ago }}</span> <app-directory-icon [pubkey]="event.pubkey"></app-directory-icon></app-event-header>
|
||||
<app-event-header [pubkey]="event.pubkey"><app-date [date]="event.created_at"> </app-date> <app-directory-icon [pubkey]="event.pubkey"></app-directory-icon></app-event-header>
|
||||
<app-event-actions [event]="event" [pubkey]="event.pubkey"></app-event-actions>
|
||||
</div>
|
||||
<app-content class="thread-content" [ngClass]="{ 'no-lines': !optionsService.options.showLines, 'lines': optionsService.options.showLines }" [event]="event"></app-content>
|
||||
|
3
src/app/shared/date/date.css
Normal file
3
src/app/shared/date/date.css
Normal file
@ -0,0 +1,3 @@
|
||||
.event-date {
|
||||
margin-right: 0.1em;
|
||||
}
|
1
src/app/shared/date/date.html
Normal file
1
src/app/shared/date/date.html
Normal file
@ -0,0 +1 @@
|
||||
<span class="event-date" (click)="toggle()" *ngIf="!isoDate">{{ date | ago }}</span> <span class="event-date" (click)="toggle()" *ngIf="isoDate">{{ date*1000 | date: 'yyyy-MM-dd HH:mm:ss' }}</span>
|
14
src/app/shared/date/date.ts
Normal file
14
src/app/shared/date/date.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import { Component, Input } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-date',
|
||||
templateUrl: 'date.html',
|
||||
styleUrls: ['date.css'],
|
||||
})
|
||||
export class DateComponent {
|
||||
@Input() date!: number;
|
||||
isoDate?: boolean;
|
||||
toggle() {
|
||||
this.isoDate = !this.isoDate;
|
||||
}
|
||||
}
|
@ -623,10 +623,6 @@ mat-sidenav-content mat-toolbar {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.event-date {
|
||||
margin-right: 0.1em;
|
||||
}
|
||||
|
||||
.options-slider {
|
||||
margin-right: 1em;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user