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: do not call period generator with non-4-digit year (DHIS2-17707) #1690

Merged
merged 1 commit into from
Jul 12, 2024

Conversation

edoardo
Copy link
Member

@edoardo edoardo commented Jul 12, 2024

Fixes DHIS2-17707


Key features

  1. avoid error in date validation with non 4-digit years

Description

multi-calendar-dates assumes the date strings have a 4 digit year, if not, a validation error is thrown.
The fix ensures the period generator functions in multi-calendar-dates are only called if the year is a 4-digit number.

The error only shows a console.log in the app, but it's causing Cypress to fail due to the error overlay covering the app.


Screenshots

Before:
Screenshot 2024-07-12 at 12 26 12

Screenshot 2024-07-04 at 13 39 40

After:
The error is not thrown and the list of periods remain unchanged:
Screenshot 2024-07-12 at 12 26 12

@edoardo edoardo merged commit f2f516d into master Jul 12, 2024
5 checks passed
@edoardo edoardo deleted the fix/fixed-period-validation-DHIS2-17707 branch July 12, 2024 11:46
dhis2-bot added a commit that referenced this pull request Jul 12, 2024
## [26.7.8](v26.7.7...v26.7.8) (2024-07-12)

### Bug Fixes

* do not call period generator with non-4-digit year (DHIS2-17707) ([#1690](#1690)) ([f2f516d](f2f516d))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 26.7.8 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants