deltahacks / portal

The attendee & admin portal for DeltaHacks, the hackathon for change.
https://portal.deltahacks.com
MIT License
10 stars 2 forks source link

fix: date bug #173

Closed fvcci closed 11 months ago

fvcci commented 11 months ago

fix the bug where users do not fill anything out for Graduation Year field and it gives them invalid date error.

Summary by CodeRabbit

netlify[bot] commented 11 months ago

Deploy Preview for profound-kringle-30b3e4 ready!

Name Link
Latest commit beeaf3a2f5e16e7d21f8496581973365001a4d49
Latest deploy log https://app.netlify.com/sites/profound-kringle-30b3e4/deploys/6584d7850502c200088175aa
Deploy Preview https://deploy-preview-173--profound-kringle-30b3e4.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

coderabbitai[bot] commented 11 months ago
Walkthrough ## Walkthrough The project has undergone a shift in handling date fields, moving from processing and validating dates as `Date` objects to using string representations directly. This change affects form inputs, validation schemas, and server routers, streamlining the handling of birthday and expected graduation dates across the application lifecycle. The update simplifies the data flow by removing unnecessary conversions and aligns the backend and frontend date formats. ## Changes | Files | Change Summary | |-----------------------------------------|----------------| | `src/components/Applicant.tsx` | Updated `FormInput` components for `birthday` and `studyExpectedGraduation` to use string data directly. | | `src/pages/apply.tsx` | Removed `studyExpectedGraduation` from `defaultValues` in `ApplyForm`. | | `src/schemas/application.ts` | Changed validation for `birthday` to direct string input; updated `studyExpectedGraduation` type to string. | | `src/server/router/application.ts` | Streamlined date assignment in `applicationRouter` by using ISO string slices for `birthday` and `studyExpectedGraduation`. | | `src/server/router/reviewers.ts` | Introduced `ApplicationSchemaWithStringDates` for date strings; updated `reviewerRouter` to use the new schema for output. |

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on X ?


Tips ### Chat with CodeRabbit Bot (`@coderabbitai`) - You can reply to a review comment made by CodeRabbit. - You can tag CodeRabbit on specific lines of code or files in the PR by tagging `@coderabbitai` in a comment. - You can tag `@coderabbitai` in a PR comment and ask one-off questions about the PR and the codebase. Use quoted replies to pass the context for follow-up questions. ### CodeRabbit Commands (invoked as PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger a review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai help` to get help. Additionally, you can add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### CodeRabbit Configration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - The JSON schema for the configuration file is available [here](https://coderabbit.ai/integrations/coderabbit-overrides.v2.json). - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json`