diff --git a/app/projects/Card2.jsx b/app/projects/Card2.jsx index b9ea884..1d0604c 100644 --- a/app/projects/Card2.jsx +++ b/app/projects/Card2.jsx @@ -27,9 +27,8 @@ import { CalendarMonth } from "@mui/icons-material"; const Card2 = ({ title, images = [], - startDate, - technologies = [], - endDate, + date, + technologies, toptext1, slug, link, @@ -60,8 +59,8 @@ const Card2 = ({ marqueeRef.current.start(); } }; - const formattedStartDate = new Date(startDate).toLocaleDateString(); - const formattedEndDate = new Date(endDate).toLocaleDateString(); + // const formattedStartDate = new Date(startDate).toLocaleDateString(); + // const formattedEndDate = new Date(endDate).toLocaleDateString(); return ( -

+

{toptext1 && `${toptext1.split(" ").slice(0, 20).join(" ")}${ toptext1.split(" ").length > 20 ? " ..." : "" @@ -162,8 +161,7 @@ const Card2 = ({ style={{ background: "blue", color: "white" }} startIcon={} > - Project Duration: {formattedStartDate} -{" "} - {formattedEndDate} + Project Duration: {date} } diff --git a/app/projects/[slug]/page.jsx b/app/projects/[slug]/page.jsx index 621eb1d..dec440d 100644 --- a/app/projects/[slug]/page.jsx +++ b/app/projects/[slug]/page.jsx @@ -52,19 +52,19 @@ export default async function ProjectCardDetail({ params }) { ), }, }; - const formattedStartDate = new Date(data.startDate).toLocaleDateString(); - const formattedEndDate = new Date(data.endDate).toLocaleDateString(); + // const formattedStartDate = new Date(data.startDate).toLocaleDateString(); + // const formattedEndDate = new Date(data.endDate).toLocaleDateString(); const canonicalUrl = `https://sufianmustafa.com/projects/${params.slug}`; // Set title, description, and other SEO metadata - const startDateObj = new Date(data.startDate); - const endDateObj = new Date(data.endDate); - const durationInDays = Math.floor( - (endDateObj - startDateObj) / (24 * 60 * 60 * 1000) - ); + // const startDateObj = new Date(data.startDate); + // const endDateObj = new Date(data.endDate); + // const durationInDays = Math.floor( + // (endDateObj - startDateObj) / (24 * 60 * 60 * 1000) + // ); // Format the duration for display - const formattedDuration = - durationInDays > 1 ? `${durationInDays} days` : `${durationInDays} day`; + // const formattedDuration = + // durationInDays > 1 ? `${durationInDays} days` : `${durationInDays} day`; const title = `${data.title} - Sufian Mustafa Projects`; const description = `${data.toptext1}`; @@ -253,19 +253,19 @@ export default async function ProjectCardDetail({ params }) {

- The project spanned from: + The project duration:
- {formattedStartDate} + {data.date} - to{" "} + {/* to{" "} {formattedEndDate} Total duration:
{formattedDuration} - + */}

diff --git a/app/projects/page.jsx b/app/projects/page.jsx index 6189035..2630e4d 100644 --- a/app/projects/page.jsx +++ b/app/projects/page.jsx @@ -98,7 +98,7 @@ export default async function ProjectAll() { />

-
+

My projects

diff --git a/sanity/package.json b/sanity/package.json index e109893..fd947ad 100644 --- a/sanity/package.json +++ b/sanity/package.json @@ -1,5 +1,5 @@ { - "name": "sanity-project-blog2", + "name": "sufian-mustafa-portfolio", "private": true, "version": "1.0.0", "main": "package.json", diff --git a/sanity/sanity.config.ts b/sanity/sanity.config.ts index 619477b..fff2382 100644 --- a/sanity/sanity.config.ts +++ b/sanity/sanity.config.ts @@ -6,7 +6,7 @@ import {codeInput} from '@sanity/code-input' export default defineConfig({ name: 'default', - title: 'Sanity Project blog2', + title: 'sufian mustafa portfolio', projectId: 'cx174xrg', dataset: 'production', diff --git a/sanity/schemas/project.ts b/sanity/schemas/project.ts index 9a580a0..17817a5 100644 --- a/sanity/schemas/project.ts +++ b/sanity/schemas/project.ts @@ -71,17 +71,12 @@ export default { }, }, { - name: 'startDate', - type: 'datetime', - title: 'Start Date', - description: 'Specify the start date/time of the project', - }, - { - name: 'endDate', - type: 'datetime', - title: 'End Date', - description: 'Specify the end date/time of the project', + name: 'date', + type: 'string', + title: 'Project Duration', + description: 'Specify the Duration of the project', }, + { name: 'content', type: 'array',