Skip to content

Commit

Permalink
New Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sufi0900 committed Feb 14, 2024
1 parent 804e6c3 commit 2f162e6
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 34 deletions.
14 changes: 6 additions & 8 deletions app/projects/Card2.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ import { CalendarMonth } from "@mui/icons-material";
const Card2 = ({
title,
images = [],
startDate,
technologies = [],
endDate,
date,
technologies,
toptext1,
slug,
link,
Expand Down Expand Up @@ -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 (
<Grid
item
Expand Down Expand Up @@ -149,7 +148,7 @@ const Card2 = ({
<ListItemText
primary={
<>
<p>
<p className="custom-input-color">
{toptext1 &&
`${toptext1.split(" ").slice(0, 20).join(" ")}${
toptext1.split(" ").length > 20 ? " ..." : ""
Expand All @@ -162,8 +161,7 @@ const Card2 = ({
style={{ background: "blue", color: "white" }}
startIcon={<CalendarMonth />}
>
Project Duration: {formattedStartDate} -{" "}
{formattedEndDate}
Project Duration: {date}
</Button>
</>
}
Expand Down
26 changes: 13 additions & 13 deletions app/projects/[slug]/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
Expand Down Expand Up @@ -253,19 +253,19 @@ export default async function ProjectCardDetail({ params }) {
</Typography>
<div style={{ display: "flex", flexWrap: "wrap" }}>
<Typography variant="h5" paragraph>
The project spanned from:
The project duration:
<br />
<Typography variant="h4" paragraph>
{formattedStartDate}
{data.date}
</Typography>
to{" "}
{/* to{" "}
<Typography variant="h4" paragraph>
{formattedEndDate}
</Typography>
Total duration: <br />
<span style={{ color: "#ff9800" }}>
{formattedDuration}
</span>
</span> */}
<br />
<hr />
</Typography>
Expand Down
2 changes: 1 addition & 1 deletion app/projects/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default async function ProjectAll() {
/>
<br />
<br />
<div className="about41" style={{ marginTop: "60px" }}>
<div className="about41 ts" style={{ marginTop: "60px" }}>
<h3>My projects</h3>
</div>

Expand Down
2 changes: 1 addition & 1 deletion sanity/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "sanity-project-blog2",
"name": "sufian-mustafa-portfolio",
"private": true,
"version": "1.0.0",
"main": "package.json",
Expand Down
2 changes: 1 addition & 1 deletion sanity/sanity.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
15 changes: 5 additions & 10 deletions sanity/schemas/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 2f162e6

Please sign in to comment.