-
Notifications
You must be signed in to change notification settings - Fork 37
Implement Trips feature (behind feature flag) #1912
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Copilot
wants to merge
8
commits into
development
Choose a base branch
from
copilot/implement-trips-feature
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
5553225
Initial plan
Copilot e19976b
Implement Trips feature: fix edit title bug, add barrel export, date …
Copilot 058daa6
Address CodeRabbit feedback: locale-aware date formatting, differenti…
Copilot d708679
fix: parse YYYY-MM-DD date strings as local dates to avoid UTC offset…
Copilot 85a078f
refactor: extract shared date parsing utility and fix Trip type defin…
andrew-bierman 9bc746f
fix: resolve biome lint and type check errors
andrew-bierman ca75bf6
Fix null-safety in trip filter and validate date components in parseL…
Copilot dc409f3
Fix CodeRabbit review issues on trips feature
andrew-bierman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| export * from './hooks'; | ||
| export * from './types'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| /** | ||
| * Parse a date string, handling YYYY-MM-DD strings as local dates | ||
| * instead of UTC (which is the default `new Date('YYYY-MM-DD')` behavior). | ||
| * | ||
| * Returns `null` for missing or invalid input. | ||
| */ | ||
| export function parseLocalDate(dateString?: string): Date | null { | ||
| if (!dateString) return null; | ||
| const dateOnlyMatch = /^(\d{4})-(\d{2})-(\d{2})$/.exec(dateString); | ||
| if (dateOnlyMatch) { | ||
| const year = Number(dateOnlyMatch[1]); | ||
| const month = Number(dateOnlyMatch[2]); | ||
| const day = Number(dateOnlyMatch[3]); | ||
| const date = new Date(year, month - 1, day); | ||
| if (Number.isNaN(date.getTime())) return null; | ||
| if (date.getFullYear() !== year || date.getMonth() !== month - 1 || date.getDate() !== day) { | ||
| return null; | ||
| } | ||
| return date; | ||
| } | ||
| const date = new Date(dateString); | ||
| return Number.isNaN(date.getTime()) ? null : date; | ||
| } | ||
|
|
||
| /** | ||
| * Format a date string for display, returning an em-dash for missing or | ||
| * invalid values. Uses the user's locale via `toLocaleDateString()`. | ||
| */ | ||
| export function formatLocalDate(dateString?: string): string { | ||
| const date = parseLocalDate(dateString); | ||
| return date ? date.toLocaleDateString() : '\u2014'; | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.