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: update minDate conditional logic (M2-8317, M2-8275, M2-8032) #2023

Merged
merged 4 commits into from
Feb 4, 2025

Conversation

ChaconC
Copy link
Contributor

@ChaconC ChaconC commented Jan 29, 2025

📝 Description

Fix minDate condition when selecting BETWEEN_DATES or OUTSIDE_OF_DATES conditional logic by using the correct value and addressing a date parsing issue.

🔗 Jira Ticket M2-8317
🔗 Jira Ticket M2-8275
🔗 Jira Ticket M2-8032

Changes include:

  • Use minDateValue instead of minValue when setting up DatePicker
  • Update date parsing to remove timezone offset effect
  • Additionally prevents setting a minDate greater than maxDate

📸 Screenshots

Case 1 (M2-8317):

Before: It's not possible to select a date prior to "today" in the second DatePicker when selecting Outside/Between conditional logic

CleanShot.2025-01-29.at.17.02.02.mp4

After: It's now possible to select a date prior to "today" but greater than the first date when selecting Outside/Between conditional logic

CleanShot.2025-01-29.at.17.02.50.mp4

Case 2 (M2-8275):

Date parsing error after saving

Before:

  • After selecting a date and pressing "Save", the date would change depending on the timezone (29 -> 28 in the video.)
  • Clicking "Save" a second time would display an error due to a date parsing issue
CleanShot.2025-01-29.at.16.56.05.mp4

After:

  • Selecting a date and clicking "Save" results in the date not changing
  • Date parsing error no longer appears, clicking Save a second time correctly reports no changes
CleanShot.2025-01-29.at.17.08.54.mp4

🪤 Peer Testing

  • Create an applet with 2 or more items, first item should be "Date" type
  • Create conditional logic using the date item in the top row
  • Select different values between Greater Than, Less Than, Outside or Between
    • For Outside/Between dates condition, it should be possible to select a date before "today" but greater than the first date.
  • Applet should save correctly

✏️ Notes

Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-2023.d19gtpld8yi51u.amplifyapp.com

Copy link
Contributor

@mbanting mbanting left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected. Code looks good. Thanks for fixing this!

@farmerpaul farmerpaul self-requested a review January 31, 2025 14:15
@farmerpaul farmerpaul changed the title fix: update minDate conditional logic (M2-8317, M2-8275) fix: update minDate conditional logic (M2-8317, M2-8275, M2-8032) Jan 31, 2025
Copy link
Contributor

@farmerpaul farmerpaul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and everything looks fixed, nice work. Just one suggestion, but preapproving.

@ChaconC ChaconC force-pushed the fix/M2-8317-mindate branch from 492af13 to e0253cf Compare February 4, 2025 16:59
@ChaconC ChaconC force-pushed the fix/M2-8317-mindate branch from e0253cf to ac1141e Compare February 4, 2025 17:01
@ChaconC ChaconC merged commit dff3c7d into develop Feb 4, 2025
6 checks passed
@ChaconC ChaconC deleted the fix/M2-8317-mindate branch February 4, 2025 17:23
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.

3 participants