Skip to content
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

Will kencel/tick date handling #439

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

wkencel
Copy link

@wkencel wkencel commented Dec 22, 2024

The error occurred because some ticks had malformed dates that couldn't be parsed into valid Date objects, causing the getTime() function to fail. This change gracefully handles those cases while maintaining the intended noon UTC standardization.

This change:

  • Handles both Date objects and string dates (references test data in src/model/tests/ticks.ts lines 19 and 31)

  • Validates dates properly before using getTime() (fixes the error in the GraphQL response)

  • Sets invalid dates to null instead of throwing errors (maintains data consistency)

  • Maintains compatibility with the America/Denver timezone standardization from the migration (references db-migrations/0003-date-climbed-to-date.js)

  • Matches the test expectations for date handling (references src/tests/ticks.ts line 193)

I also added a test. screenshots on repro of error, successful testing after change and successful running test

Repro1 repro2

After Change
VerificationOfFix
Screenshot 2024-12-21 at 4 50 59 PM

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.

1 participant