...fix sort bug

This commit is contained in:
Chuck Dries 2023-03-07 21:58:46 -08:00
parent 35e6211170
commit cc8fa20531
2 changed files with 5 additions and 8 deletions

View File

@ -277,7 +277,7 @@ const GalleryPage = ({ data }: PageProps<Queries.GalleryPageQueryQuery>) => {
</div>
</div>
</div>
{/* <MasonryGallery
<MasonryGallery
aspectsByBreakpoint={{
xs: 2,
sm: 2,
@ -295,7 +295,7 @@ const GalleryPage = ({ data }: PageProps<Queries.GalleryPageQueryQuery>) => {
filterKeyword,
}}
showPalette={showPalette}
/> */}
/>
</>
);
};

View File

@ -140,12 +140,9 @@ export function compareDates<T>(
left: T,
right: T
): number {
const d1 = pathOr("", date_path, left);
console.log("🚀 ~ file: utils.ts:129 ~ d1:", d1);
const date1 = new Date(d1);
console.log("🚀 ~ file: utils.ts:146 ~ new Date(d1):", new Date(d1))
console.log("🚀 ~ file: utils.ts:133 ~ date1:", date1);
const date2 = new Date(pathOr("", date_path, right));
// why tf do my dates have newlines in them?!?!
const date1 = new Date(pathOr("", date_path, left).replace(/\s/g, ''));
const date2 = new Date(pathOr("", date_path, right).replace(/\s/g, ''));
const diff = -1 * (date1.getTime() - date2.getTime());
return diff;
}