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

feat: merge multi-calendar support from alpha to master #1434

Merged
merged 17 commits into from
Feb 23, 2023
Merged

feat: merge multi-calendar support from alpha to master #1434

merged 17 commits into from
Feb 23, 2023

Conversation

kabaros
Copy link
Contributor

@kabaros kabaros commented Feb 23, 2023

This PR includes the updates to alpha channel to use the multi-calendar-dates library to generate fixed periods in order to support non-Gregorian calendrical systems (such as Nepali and Ethiopic).

Implements DHIS2-14709. Used in this Data-Visualiser PR: dhis2/data-visualizer-app#2233

Notes

  • The previous implementation came with an comprehensive set of snapshot tests that cover all period generation scenarios and edge cases (especially with EPI week generation). This test suite guided this new implementation, to ensure that all the subtle edge cases were covered.

  • The bulk of these changes were reviewed by Edoardo, Abyot and Hendrik in this PR. The description and discussions there can provide more context for the changes.

Testing

  • This can be tested from the Data-Visualiser PR deploy link which uses the alpha release. For the purpose of merging this PR, the testing should concentrate on testing the Gregorian calendar fixed periods in Data-Visualiser and ensure that it still has the same behaviour as before.

  • [optional] Testing for other calendrical systems (ethiopic and nepali) can be done as well, but only for the FE, as we don't have a readily-available DHIS2 instance configured with these calendars.


Key features

  1. Generate fixed periods in multiple calendrical systems (i.e. Gregorian, Nepali, Ethiopic etc...)
  2. Get the current date in multiple calendars
  3. Consume and use the currently configured calendar in DHIS2
  4. Localise periods using browsers' Intl.DateTimeFormat

BREAKING CHANGE

No breaking change. The existing period generation logic in analytics came with an exhaustive suite of tests. The library used those as a specs to guide the implementation, and make sure they all pass, so the library should not change the existing behaviour, only extend it to support other calendars ✅


Screenshots

dv-multi-calendars.mov

kabaros and others added 16 commits February 2, 2023 21:25
feat: use multi-calendar-dates library to generate fixed periods
# [24.5.0-alpha.1](v24.4.2...v24.5.0-alpha.1) (2023-02-07)

### Bug Fixes

* ensure date falls back to year if no eraYear present ([2a197d5](2a197d5))

### Features

* use multi-calendar-dates library to generate fixed periods ([acc3801](acc3801))
fix: bump multi-calendar-dates to avoid jest config change
# [24.5.0-alpha.2](v24.5.0-alpha.1...v24.5.0-alpha.2) (2023-02-14)

### Bug Fixes

* bump multi-calendar-dates to avoid jest config change ([3e5892a](3e5892a))
feat: localise multi-calendar fixed periods according to user locale
# [24.5.0-alpha.3](v24.5.0-alpha.2...v24.5.0-alpha.3) (2023-02-23)

### Features

* localise fixed periods according to user settings ([c640c90](c640c90))
# [24.9.0-alpha.1](v24.8.0...v24.9.0-alpha.1) (2023-02-23)

### Bug Fixes

* bump multi-calendar-dates to avoid jest config change ([3e5892a](3e5892a))
* ensure date falls back to year if no eraYear present ([2a197d5](2a197d5))

### Features

* localise fixed periods according to user settings ([c640c90](c640c90))
* use multi-calendar-dates library to generate fixed periods ([acc3801](acc3801))
@kabaros kabaros changed the title Alpha feat: merge multi-calendar support from alpha to master Feb 23, 2023
@kabaros kabaros marked this pull request as ready for review February 23, 2023 10:39
@kabaros kabaros requested review from HendrikThePendric and a team February 23, 2023 10:40
@kabaros kabaros merged commit 3cdac8f into master Feb 23, 2023
@kabaros kabaros deleted the alpha branch February 23, 2023 13:07
@kabaros kabaros restored the alpha branch February 23, 2023 13:55
@@ -6980,6 +6996,11 @@ classnames@^2.2.5, classnames@^2.2.6, classnames@^2.3.1:
resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.3.1.tgz#dfcfa3891e306ec1dad105d0e88f4417b8535e8e"
integrity sha512-OlQdbZ7gLfGarSqxesMesDa5uz7KFbID8Kpq/SxIoNGDqY8lSYs0D+hhtBXhcdB3rcbXArFr7vlHheLk1voeNA==

classnames@^2.3.2:
version "2.3.2"
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a duplicate of classnames@^2.2.5, classnames@^2.2.6, classnames@^2.3.1 above.
Both should resolve to 2.3.2

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated it here since this PR was already merged.

dhis2-bot added a commit that referenced this pull request Feb 24, 2023
# [24.9.0](v24.8.0...v24.9.0) (2023-02-24)

### Features

* merge multi-calendar support from alpha to master ([#1434](#1434)) ([3cdac8f](3cdac8f))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 24.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

kabaros added a commit that referenced this pull request Mar 1, 2023
* feat: use multi-calendar-dates library to generate fixed periods

* fix: ensure date falls back to year if no eraYear present

* refactor: remove unnecessary default value for config

* test: fix failing test

* chore(release): cut 24.5.0-alpha.1 [skip ci]

* ensure date falls back to year if no eraYear present ([2a197d5](2a197d5))

* use multi-calendar-dates library to generate fixed periods ([acc3801](acc3801))

* fix: bump multi-calendar-dates to avoid jest config change

* chore(release): cut 24.5.0-alpha.2 [skip ci]

* bump multi-calendar-dates to avoid jest config change ([3e5892a](3e5892a))

* feat: localise fixed periods according to user settings

* chore: bump @dhis2/multi-calendar-dates to main version

* chore(release): cut 24.5.0-alpha.3 [skip ci]

* localise fixed periods according to user settings ([c640c90](c640c90))

* chore(release): cut 24.9.0-alpha.1 [skip ci]

* bump multi-calendar-dates to avoid jest config change ([3e5892a](3e5892a))
* ensure date falls back to year if no eraYear present ([2a197d5](2a197d5))

* localise fixed periods according to user settings ([c640c90](c640c90))
* use multi-calendar-dates library to generate fixed periods ([acc3801](acc3801))

* refactor: move period settings to parent container component

---------

Co-authored-by: @dhis2-bot <apps@dhis2.org>
dhis2-bot added a commit that referenced this pull request Mar 2, 2023
# [21.9.0](v21.8.2...v21.9.0) (2023-03-02)

### Features

* merge multi-calendar support from alpha to master ([#1434](#1434)) ([9bacb7c](9bacb7c))
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

5 participants