this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

🚸 Show ongoing works on on top of work grids regardless of their start dates

gwen.works 1cfd29b2 9c881e89

verified
+10 -6
+10 -6
src/components/WorksGrid.astro
··· 1 1 --- 2 2 import type { InferEntrySchema } from "astro:content"; 3 - import { formatISO, format } from "date-fns"; 4 - import { fr as frFR, enUS } from "date-fns/locale"; 5 - import { compareDesc } from "date-fns"; 6 - import Translated from "./Translated.astro"; 7 - import WIPIndicator from "./WIPIndicator.astro"; 3 + import { compareDesc, formatISO } from "date-fns"; 8 4 import { setCssColors } from "../colors"; 9 5 import { imageAttrs } from "../pages/works/media"; 6 + import Translated from "./Translated.astro"; 7 + import WIPIndicator from "./WIPIndicator.astro"; 10 8 11 9 const EXCLUDED_WORKS = ["calen7drier"]; 12 10 ··· 23 21 started: Date | null; 24 22 finished: Date | null; 25 23 additionalMetadata?: { created?: Date | null | undefined }; 26 - }) => finished ?? started ?? additionalMetadata?.created; 24 + }) => { 25 + if (started && !finished && !additionalMetadata?.created) { 26 + // Ongoing works 27 + return new Date(); 28 + } 29 + return finished ?? started ?? additionalMetadata?.created; 30 + }; 27 31 28 32 function groupBy<T, K extends string | number>( 29 33 items: T[],