-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathPastEvent.ts
More file actions
39 lines (37 loc) · 1.32 KB
/
PastEvent.ts
File metadata and controls
39 lines (37 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import * as dto from './dto';
import * as html from './html';
import * as moment from 'moment';
import ComponentsArray from './ComponentsArray';
import Countdown from './Countdown';
import UiComponent from './UiComponent';
import Timestamp from './Timestamp';
export default class PastEvent implements UiComponent {
constructor(private _event: dto.Event) {
}
appendTo(entry: HTMLElement | null): void {
new html.Div(
new ComponentsArray([
new Timestamp(this._event.timestamp()),
new html.H1(
new html.Href(
`${this._event.url}`,
new html.Text(`${this._event.title}`)
)
),
new Countdown(this._event.datetime, "finished "),
new html.Div(
new html.Href(
this._event.channel,
new html.Text(this._event.channel)),
{"class": "channel"}
),
new html.Div(
new html.Markdown(`${this._event.description}`),
{"class": "description markdown"}
)
]),
{"class": "event past",
"id": `_${this._event.datetime.utc().unix()}`}
).appendTo(entry)
}
}