Skip to content

fix: convert commit date string to iso8601#15

Merged
jjleng merged 1 commit intomainfrom
fix-date-formating
Apr 7, 2025
Merged

fix: convert commit date string to iso8601#15
jjleng merged 1 commit intomainfrom
fix-date-formating

Conversation

@jjleng
Copy link
Copy Markdown
Owner

@jjleng jjleng commented Apr 7, 2025

This pull request includes changes to the cp-webapp project, specifically focusing on date formatting improvements and utility functions. The main changes involve adding a new utility function for date conversion and updating the CommitsList component to use this function.

Date formatting improvements:

Utility functions:

@jjleng jjleng requested a review from Copilot April 7, 2025 20:34
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

cp-webapp/src/lib/utils.ts:31

  • Consider including the actual input value in the error message to aid in debugging, e.g., 'Invalid date format (received: ' + dateString + '). Expected format: YYYY-MM-DD HH:MM:SS ±HHMM'.
throw new Error('Invalid date format. Expected format: YYYY-MM-DD HH:MM:SS ±HHMM');

cp-webapp/src/components/snapshot-view/commits-list.tsx:160

  • Consider wrapping the call to convertToISO8601 in a try-catch block to handle potential errors from unexpected date formats and avoid runtime exceptions.
{new Date(convertToISO8601(commit.date)).toLocaleString(undefined, {

@jjleng jjleng merged commit a00fc47 into main Apr 7, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants