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

Fix date range select displaying negative values for ranges in the past #1246

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

pleek91
Copy link
Collaborator

@pleek91 pleek91 commented Apr 25, 2024

Description

Since date-fns was updated to 3.x in #1212 PDateRangeSelect has been displaying negative values for date ranges in the past. Displaying labels like Past -7 days rather than Past 7 days. This was because intervalToDuration now respects negative/inverted date ranges.

Since we always want a positive duration I've added Math.abs around the value we're creating the duration from which forces it to always return a positive duration.

@pleek91 pleek91 requested a review from a team as a code owner April 25, 2024 13:52
Copy link

netlify bot commented Apr 25, 2024

Deploy Preview for prefect-design ready!

Name Link
🔨 Latest commit af74778
🔍 Latest deploy log https://app.netlify.com/sites/prefect-design/deploys/662a6034fd2339000884639e
😎 Deploy Preview https://deploy-preview-1246--prefect-design.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.

@pleek91 pleek91 merged commit 2bfb642 into main Apr 25, 2024
6 checks passed
@pleek91 pleek91 deleted the fix-date-range-select-negative-ranges branch April 25, 2024 13:58
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