use js dates for recent cards

This commit is contained in:
2024-11-28 16:51:55 -05:00
parent 12e79791da
commit 3703adabc9
2 changed files with 2 additions and 11 deletions
@@ -39,18 +39,13 @@ export default function RecentPhoto() {
console.log(data)
}, [data])
const parseDate = (date: Date) => {
const jsDate = new Date(date);
return `${jsDate.getFullYear()}/${jsDate.getMonth() + 1}/${jsDate.getDate()}`;
}
if (data && !loading) {
return (
<ProjectComponent
url={"https://photos.alexav.gg?id=" + data.id}
header={"Photos I've captured"}
projectHeader={data.name}
projectSubheader={`Taken on ${parseDate(data.dateTaken as Date)}`}
projectSubheader={`Taken on ${new Date(data.dateTaken).toLocaleDateString()}`}
projectImage={data.imageUrl}
projectImageSize={"85"}
/>
@@ -44,15 +44,11 @@ export default function RecentWatch() {
})
}, []);
const parseDate = (date: Date) => {
const jsDate = new Date(date);
return `${jsDate.getFullYear()}/${jsDate.getMonth() + 1}/${jsDate.getDate()}`;
}
const getSubheaderText = () => {
if (data?.finished) {
return "Finished!"
} else if (data?.startedOn) {
return "Started on " + parseDate(data.startedOn)
return "Started on " + new Date(data.startedOn).toLocaleDateString()
} else {
return "Just Added"
}