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: Nepali calendar support #19438

Open
wants to merge 7 commits into
base: 2.40
Choose a base branch
from
Open

fix: Nepali calendar support #19438

wants to merge 7 commits into from

Conversation

abyot
Copy link
Member

@abyot abyot commented Dec 11, 2024

  • ISO period names should match Nepali calendar. Baisakh 2081 is 208101 not 202404
  • Fix to weekly periods start and end dates

@abyot abyot marked this pull request as ready for review December 13, 2024 12:45
@maikelarabori maikelarabori added the run-api-analytics-tests Enables analytics e2e tests label Dec 16, 2024
Copy link
Contributor

@maikelarabori maikelarabori left a comment

Choose a reason for hiding this comment

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

Thanks for the changes @abyot, I left some questions and suggestions.
Please, take a look... thanks!

/*
* https://en.m.wikipedia.org/wiki/ISO_week_date
*/
int week = (10 + getDayOfYear(dateTimeUnit) - isoWeekday(dateTimeUnit)) / 7;
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add constants to the integers here?
Also, a Javadoc would be nice. The Wikipedia website can be left as a reference.

toIso(dateTimeUnit).toJodaDateTime(ISOChronology.getInstance(DateTimeZone.getDefault()));
return dateTime.getDayOfWeek();
/*
* calculating week day from calendar dateTimeUnit is best managed
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* calculating week day from calendar dateTimeUnit is best managed
* Calculating week day from calendar dateTimeUnit is best managed

@@ -475,6 +500,39 @@ private DateInterval toDayIsoInterval(DateTimeUnit dateTimeUnit, int offset, int
private static final Map<Integer, int[]> CONVERSION_MAP = new HashMap<>();
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a comment, so we know until which year this is valid?
I belive that at some point we need to add more elements to the map...?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run-api-analytics-tests Enables analytics e2e tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants