counterscale icon indicating copy to clipboard operation
counterscale copied to clipboard

Enhance Date Interval Handling and Add "Yesterday" Interval Support

Open DylanPetrey opened this issue 1 year ago • 1 comments

Refs #3

Description:

This pull request introduces several improvements and new features:

1. Enhanced Date Interval Handling

  • Refactor intervalToSql function to return both start and end interval SQL for better accuracy.
  • Update test cases to reflect changes in interval handling.
  • Adjust various API calls to utilize both start and end interval SQL.

2. "Yesterday" Interval Support

  • Add support for "yesterday" interval in analytics queries.
  • Update relevant test cases to cover the new "yesterday" interval.
  • Extend generateEmptyRowsOverInterval function to handle "yesterday" interval correctly.
  • Modify the dashboard loader and UI to support the "yesterday" interval option.

Changes:

  • Files Modified:
    • app/analytics/__tests__/query.test.ts
    • app/analytics/query.ts
    • app/routes/dashboard.tsx
    • package-lock.json

DylanPetrey avatar Oct 07 '24 02:10 DylanPetrey

image

DylanPetrey avatar Oct 07 '24 12:10 DylanPetrey

Should I have made this on the v2 route?

DylanPetrey avatar Oct 11 '24 01:10 DylanPetrey

Thanks for the PR. Sorry, I've been travelling for the past few weeks and haven't had an opportunity to review it.

Should I have made this on the v2 route?

Nope – you're good. That branch became main. I should delete it.

benvinegar avatar Oct 21 '24 04:10 benvinegar

Going to merge this. As a follow on, IMO, the query should be both >= and <= on both start/end boundaries, but doubt second-level precision is going to matter to anyone.

benvinegar avatar Oct 26 '24 20:10 benvinegar

Thank you @DylanPetrey!

benvinegar avatar Oct 26 '24 20:10 benvinegar