Mercurial > code > home > repos > front-door-display
comparison src/UpcomingEvents.ts @ 20:e8c90d893919
layout and sorting
author | drewp@bigasterisk.com |
---|---|
date | Mon, 26 Aug 2024 16:17:49 -0700 |
parents | 472003015880 |
children |
comparison
equal
deleted
inserted
replaced
19:6960c172f1a9 | 20:e8c90d893919 |
---|---|
1 import { LitElement, css, html } from "lit"; | 1 import { LitElement, css, html } from "lit"; |
2 import { customElement, property } from "lit/decorators.js"; | 2 import { customElement, property } from "lit/decorators.js"; |
3 import { sortBy } from "lodash"; | 3 import { sortBy, sortedUniqBy } from "lodash"; |
4 import { DataFactory, Quad_Subject, Store } from "n3"; | 4 import { DataFactory, Quad_Subject, Store } from "n3"; |
5 import { shared } from "./shared"; | 5 import { shared } from "./shared"; |
6 import { EV, fetchGraph, parseGraph, RDF } from "./parseRdf"; | 6 import { EV, fetchGraph, parseGraph, RDF } from "./parseRdf"; |
7 import { DisplayEvent } from "./DisplayEvent"; | 7 import { DisplayEvent } from "./DisplayEvent"; |
8 | 8 |
32 const de = new DisplayEvent(store, graph, ev); | 32 const de = new DisplayEvent(store, graph, ev); |
33 if (de.show()) { | 33 if (de.show()) { |
34 this.evs = [...this.evs, de]; | 34 this.evs = [...this.evs, de]; |
35 } | 35 } |
36 }); | 36 }); |
37 this.evs = sortBy(this.evs, "start"); | 37 this.evs = sortedUniqBy(sortBy(this.evs, "start"), (de) => de.start + de.title); |
38 }); | 38 }); |
39 } | 39 } |
40 | 40 |
41 render() { | 41 render() { |
42 return html` | 42 return html` |