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

Restructure date calculations to avoid manual modular logic #33788

Merged
merged 1 commit into from
Dec 30, 2024

Conversation

Mitch-A6
Copy link
Contributor

@Mitch-A6 Mitch-A6 commented Dec 27, 2024

Are you removing, renaming or moving a folder in this PR?

  • No, I'm not changing any folders (skip to TeamSites and delete the rest of this section)

TeamSites

Did you change site-wide styles, platform utilities or other infrastructure?

Summary

  • Replace manual string-based date math with JS date manipulation to stabilize tests and logic.
  • The previous implementation calculated December dates such that e.g., 2024-12-27 became 2025-00-27, which was incorrectly considered above 2024-12-31. This PR replaces the manual date + year manipulation and modular math with JS's Date.setMonth() logic. As a pleasant surprise, date.setMonth(date.getMonth()+2) even correctly shifts across year boundaries.
  • Health Care Application 10-10EZ/CG Team

Related issue(s)

Testing done

  • Before this fix, this would incorrectly determine dates after December 25th to be unpaused rather than paused.
  • Specs and automated tests passing, due to this fix
  • ⚠️ direct testing?

What areas of the site does it impact?

⚠️ (Describe what parts of the site are impacted if code touched other areas)

Acceptance criteria

Quality Assurance & Testing

  • I fixed|updated|added unit tests and integration tests for each feature (if applicable).
  • No sensitive information (i.e. PII/credentials/internal URLs/etc.) is captured in logging, hardcoded, or specs
  • Linting warnings have been addressed
  • Documentation has been updated (link to documentation *if necessary)
  • Screenshot of the developed feature is added
  • Accessibility testing has been performed

Error Handling

  • Browser console contains no warnings or errors.
  • Events are being sent to the appropriate logging solution
  • Feature/bug has a monitor built into Datadog or Grafana (if applicable)

Authentication

  • Did you login to a local build and verify all authenticated routes work as expected with a test user

Requested Feedback

(OPTIONAL) What should the reviewers know in addition to the above. Is there anything specific you wish the reviewer to assist with. Do you have any concerns with this PR, why?

IGallupSoCo

This comment was marked as duplicate.

@IGallupSoCo IGallupSoCo marked this pull request as ready for review December 27, 2024 23:44
@IGallupSoCo IGallupSoCo requested review from a team as code owners December 27, 2024 23:44
Copy link
Contributor

@IGallupSoCo IGallupSoCo left a comment

Choose a reason for hiding this comment

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

LGTM

@IGallupSoCo IGallupSoCo merged commit 8d6590c into main Dec 30, 2024
72 of 73 checks passed
@IGallupSoCo IGallupSoCo deleted the msaltykov-2024-12-27-specfix-payment-paused-date branch December 30, 2024 14:40
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