diff options
| author | Joe Carstairs <118172583+jcarstairs-scottlogic@users.noreply.github.com> | 2024-07-16 14:49:24 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-16 14:49:24 +0100 |
| commit | 3cac1825bf3c600c07c4da39882f4a7d113eaa18 (patch) | |
| tree | 19734a5525c63f28d211c076613aaa0749382b56 /website/src/components | |
| parent | 2cf3723b8cb30f8eaab10bd5e6ab3b860480aac9 (diff) | |
| parent | a54b4da11561d4e556d140c0ddc8b90449b951a3 (diff) | |
Merge pull request #10 from joeacarstairs/word-hallucination-llms
The word 'hallucination' with reference to LLMs
Diffstat (limited to 'website/src/components')
| -rw-r--r-- | website/src/components/BlogFeed.astro | 4 | ||||
| -rw-r--r-- | website/src/components/LinksFeed.astro | 17 |
2 files changed, 5 insertions, 16 deletions
diff --git a/website/src/components/BlogFeed.astro b/website/src/components/BlogFeed.astro index 3d6352d..f1559b9 100644 --- a/website/src/components/BlogFeed.astro +++ b/website/src/components/BlogFeed.astro @@ -27,8 +27,8 @@ function matchesYear(year: number) { } function sortByPubDateDescending(post1: CollectionEntry<'blog'>, post2: CollectionEntry<'blog'>) { - const date1 = post1.data.pubDate.getMilliseconds(); - const date2 = post2.data.pubDate.getMilliseconds(); + const date1 = post1.data.pubDate.getTime(); + const date2 = post2.data.pubDate.getTime(); return date2 - date1; } diff --git a/website/src/components/LinksFeed.astro b/website/src/components/LinksFeed.astro index fbbf9f4..9e7e788 100644 --- a/website/src/components/LinksFeed.astro +++ b/website/src/components/LinksFeed.astro @@ -29,20 +29,9 @@ function matchesYear(year: string) { } function sortByDateAddedDescending(link1: (typeof links)[number], link2: (typeof links)[number]) { - const year1 = Number.parseInt(link1.isoDateAdded.slice(0, 4)); - const year2 = Number.parseInt(link2.isoDateAdded.slice(0, 4)); - const month1 = Number.parseInt(link1.isoDateAdded.slice(5, 7)); - const month2 = Number.parseInt(link2.isoDateAdded.slice(5, 7)); - const day1 = Number.parseInt(link1.isoDateAdded.slice(8, 10)); - const day2 = Number.parseInt(link2.isoDateAdded.slice(8, 10)); - - if (year1 !== year2) { - return year2 - year1; - } else if (month1 !== month2) { - return month2 - month1; - } else { - return day2 - day1; - } + const date1 = new Date(link1.isoDateAdded).getTime(); + const date2 = new Date(link2.isoDateAdded).getTime(); + return date2 - date1; } const canonicalLinksUrl = new URL('links', Astro.site) |
