mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-07-03 15:16:40 -04:00
more optimization/error handling
This commit is contained in:
@ -2,7 +2,6 @@ import { NextSeo } from "next-seo";
|
||||
import Content from "../../components/Content";
|
||||
import NotesList, { NotesListProps } from "../../components/NotesList";
|
||||
import { getAllNotes } from "../../lib/helpers/parse-notes";
|
||||
import { formatDateTZ } from "../../lib/helpers/format-date";
|
||||
import type { GetStaticProps } from "next";
|
||||
|
||||
const Notes = ({ notesByYear }: NotesListProps) => (
|
||||
@ -26,7 +25,7 @@ export const getStaticProps: GetStaticProps = async () => {
|
||||
const notesByYear: NotesListProps["notesByYear"] = {};
|
||||
|
||||
getAllNotes().map((note) => {
|
||||
const year = formatDateTZ(note.date, "yyyy");
|
||||
const year = new Date(note.date).getUTCFullYear();
|
||||
(notesByYear[year] || (notesByYear[year] = [])).push(note);
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user