Skip to content

Commit e966efb

Browse files
committed
Show announcement creation date
1 parent 0a984ad commit e966efb

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

src/app/api/types/announcement.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ export interface Announcement {
22
announcementId: string;
33
title: string;
44
text: string;
5+
createdAt: Date | undefined;
56
}

src/app/components/items/announcement.component.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ import { ClientService } from '../../api/client.service';
88
import { BannerService } from '../../banners/banner.service';
99
import { RefreshApiError } from '../../api/refresh-api-error';
1010
import { ConfirmationDialogComponent } from "../ui/confirmation-dialog.component";
11+
import { DateComponent } from "../ui/info/date.component";
1112

1213
@Component({
1314
selector: 'app-announcement',
1415
imports: [
1516
FaIconComponent,
1617
ButtonComponent,
17-
ConfirmationDialogComponent
18+
ConfirmationDialogComponent,
19+
DateComponent
1820
],
1921
template: `
2022
<div class="bg-yellow rounded px-5 py-2.5">
@@ -30,6 +32,15 @@ import { ConfirmationDialogComponent } from "../ui/confirmation-dialog.component
3032
</div>
3133
3234
<p class="word-wrap-and-break">{{data.text}}</p>
35+
36+
@if (data.createdAt != null) {
37+
<div class="flex flex-row justify-end">
38+
<span class="italic">
39+
posted
40+
<app-date [date]="data.createdAt"></app-date>
41+
</span>
42+
</div>
43+
}
3344
</div>
3445
3546
@defer (when showDeletionDialog) { @if (showDeletionDialog) {

src/app/pages/mod-panel/mod-panel.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export class ModPanelComponent {
5858
announcementId: "",
5959
title: "",
6060
text: "",
61+
createdAt: undefined,
6162
};
6263
protected announcementForm = new FormGroup({
6364
title: new FormControl(),
@@ -147,6 +148,7 @@ export class ModPanelComponent {
147148
announcementId: "",
148149
title: "",
149150
text: "",
151+
createdAt: undefined,
150152
};
151153
}
152154

0 commit comments

Comments
 (0)