Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.cloudflare
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VITE_DEPLOY_COMMIT_SHA=$CF_PAGES_COMMIT_SHA
VITE_DEPLOY_COMMIT_BRANCH=$CF_PAGES_BRANCH

VITE_APP_VERSION="2.4.0"
VITE_APP_VERSION="2.4.1"
2 changes: 1 addition & 1 deletion content/timeline/bachelors_degree.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: 'Bachelor of Software Engineering'
company: 'Auburn University'
group: 'Education'
dates: '08/01/2018 - 12/31/2022'
dates: 'Aug 2018 - Dec 2022'
order: 0
url: 'https://auburn.edu'
---
2 changes: 1 addition & 1 deletion content/timeline/cws.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: 'Associate Systems Engineer'
company: 'Campus Web Solutions'
group: 'Work'
dates: '01/01/2023 - Present'
dates: 'Jan 2023 - Present'
order: 2
url: 'https://cws.auburn.edu/cws'
---
2 changes: 1 addition & 1 deletion content/timeline/cws_coop.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: 'Co-op Web Developer'
company: 'Campus Web Solutions'
group: 'Work'
dates: '01/01/2021 - 05/31/2021, 08/01/2021 - 12/31/2021, 05/01/2022 - 08/31/2022'
dates: 'Jan 2021 - May 2021, Aug 2021 - Dec 2021, May 2022 - Aug 2022'
order: 1
url: 'https://cws.auburn.edu/cws'
---
2 changes: 1 addition & 1 deletion content/timeline/masters_degree.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: 'Masters of Science in Computer Science and Software Engineering'
company: 'Auburn University'
group: 'Education'
dates: '01/01/2024 - Present'
dates: 'Jan 2024 - Present'
order: 3
url: 'https://auburn.edu'
---
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cadamsmith-web",
"private": true,
"version": "2.4.0",
"version": "2.4.1",
"type": "module",
"scripts": {
"dev": "vite dev",
Expand Down
32 changes: 1 addition & 31 deletions src/lib/components/Timeline.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,6 @@

let currentGroup = $state('Work');

// format date range to be in the format of "Jan 2024 - Mar 2025"
function formatDateRange(start: string, end: string) {
const currentDate = new Date();
const startDate = new Date(start);
const endDate = new Date(end);

// Set all times to midnight for accurate day comparison
currentDate.setUTCHours(0, 0, 0, 0);

// Check if endDate is today or in the future
if (endDate >= currentDate) {
return `${formatDate(startDate)} - Present`;
}
return `${formatDate(startDate)} - ${formatDate(endDate)}`;
}

function formatDate(date: Date) {
return date.toLocaleDateString('en-US', {
month: 'short',
year: 'numeric',
timeZone: 'UTC'
});
}

function formatTimelineRange(dateRanges: [string, string][]) {
return dateRanges
.map((dateRange) => formatDateRange(dateRange[0], dateRange[1]))
.join(', ');
}

function handleGroupChange(group: string) {
currentGroup = group;
}
Expand Down Expand Up @@ -64,7 +34,7 @@
</div>
</div>
<div class="timeline-item-right">
<p>{formatTimelineRange(timelineItem.dates)}</p>
<p>{timelineItem.dates}</p>
<h3>{timelineItem.company}</h3>
<p>{timelineItem.title}</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/types/TimelineItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ export interface TimelineItem {
company: string;
group: string;
order: number;
dates: [string, string][];
dates: string;
url: string;
}
28 changes: 1 addition & 27 deletions src/lib/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,37 +72,11 @@ export const fetchMarkdownTimelineItems = async (): Promise<TimelineItem[]> => {
};
};

// Process date ranges from string format to array of ISO date strings
// Example input: "January 2020 - March 2022, April 2022 - Present"
const dates = metadata.dates.split(',').map((date) => {
const [startDate, endDate] = date.trim().split(' - ');

// Create dates with UTC to avoid timezone issues
const startDateObj = new Date(startDate);

// Set to UTC midnight to avoid date shifting when converting to different timezones
startDateObj.setUTCHours(0, 0, 0, 0);

let endDateObj: Date;

// Handle 'Present' as the current date
if (endDate === 'Present') {
endDateObj = new Date();
endDateObj.setUTCHours(0, 0, 0, 0);
} else {
endDateObj = new Date(endDate);
endDateObj.setUTCHours(0, 0, 0, 0);
}

// Return as tuple of ISO strings for consistent date formatting
return [startDateObj.toISOString(), endDateObj.toISOString()] as [string, string];
});

return {
title: metadata.title,
company: metadata.company,
group: metadata.group,
dates: dates,
dates: metadata.dates,
order: metadata.order,
url: metadata.url
};
Expand Down
2 changes: 1 addition & 1 deletion src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

const cwsWebsiteUrl = 'https://cws.auburn.edu/cws';

// get years of work experience in 0.5 year increments
const now = new Date();
const startDate = new Date(2023, 0, 1); // January 1, 2023
const monthsDiff =
Expand Down Expand Up @@ -319,6 +318,7 @@
.map-wrapper {
width: 18rem;
height: 15rem;
flex-shrink: 0;
}

.journey-content {
Expand Down
Loading