use js dates for recent cards
This commit is contained in:
@@ -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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user