Skip to content

Commit

Permalink
fix(team): remove .toSorted as not compatible with node version
Browse files Browse the repository at this point in the history
  • Loading branch information
Akeboshiwind committed Jan 15, 2024
1 parent 2b394ea commit c7c177d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/pages/team/[code].astro
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,14 @@ const unfilteredBlogs = await parseBlogs({
...authorImageImport
})
const blogs = unfilteredBlogs
.filter(({ draft, author }) => (isDev || !draft) && (author == code))
// Sort by publishedDate
// NOTE: There's a potential bug here with dates being in different formats
// e.g. Kpow has the date: 29 Mar 2023, but most other posts use ISO format 2023-03-29
.toSorted((a, b) => new Date(b.publishedDate) - new Date(a.publishedDate));
const filteredBlogs = unfilteredBlogs
.filter(({ draft, author }) => (isDev || !draft) && (author == code));
// Sort by publishedDate
// NOTE: There's a potential bug here with dates being in different formats
// e.g. Kpow has the date: 29 Mar 2023, but most other posts use ISO format 2023-03-29
const blogs = filteredBlogs
.sort((a, b) => new Date(b.publishedDate) - new Date(a.publishedDate));
// TODO: Error on required properties?
// - fullName, jobTitle, expertise
Expand Down

0 comments on commit c7c177d

Please sign in to comment.