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

View File

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