-
Notifications
You must be signed in to change notification settings - Fork 354
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
abyot
wants to merge
7
commits into
2.40
Choose a base branch
from
2.40-DHIS2-18268
base: 2.40
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+139
−33
Open
fix: Nepali calendar support #19438
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
74ba46e
fix: Resturn iso period name in user calendar
abyot b719cd9
fix: Weekly period generation for Nepali calendar
abyot 782cad5
chore: Code formatting
abyot ceb4d3a
chore: Cleanup
abyot 229edc4
chore: Cleanup
abyot 5e83e7f
Merge branch '2.40' into 2.40-DHIS2-18268
maikelarabori 7397f1c
Merge branch '2.40' into 2.40-DHIS2-18268
larshelge File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -27,6 +27,7 @@ | |||||
*/ | ||||||
package org.hisp.dhis.calendar.impl; | ||||||
|
||||||
import java.time.LocalDate; | ||||||
import java.util.Date; | ||||||
import java.util.HashMap; | ||||||
import java.util.Map; | ||||||
|
@@ -144,25 +145,36 @@ public int isoWeek(DateTimeUnit dateTimeUnit) { | |||||
|
||||||
@Override | ||||||
public int week(DateTimeUnit dateTimeUnit) { | ||||||
return isoWeek(dateTimeUnit); | ||||||
/* | ||||||
* https://en.m.wikipedia.org/wiki/ISO_week_date | ||||||
*/ | ||||||
int week = (10 + getDayOfYear(dateTimeUnit) - isoWeekday(dateTimeUnit)) / 7; | ||||||
if (week < 1) { | ||||||
week = 52; | ||||||
} else if (week > 52) { | ||||||
week = 1; | ||||||
} | ||||||
return week; | ||||||
} | ||||||
|
||||||
@Override | ||||||
public int isoWeekday(DateTimeUnit dateTimeUnit) { | ||||||
DateTime dateTime = | ||||||
toIso(dateTimeUnit).toJodaDateTime(ISOChronology.getInstance(DateTimeZone.getDefault())); | ||||||
return dateTime.getDayOfWeek(); | ||||||
/* | ||||||
* calculating week day from calendar dateTimeUnit is best managed | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
* via Gregorian calendar as week duration is 7 days in 'all' calendars | ||||||
* and Mon = Day 1, Tue = Day 2, Wed = Day 3, ... | ||||||
*/ | ||||||
DateTimeUnit isoDateTimeUnit = toIso(dateTimeUnit); | ||||||
|
||||||
LocalDate localDate = | ||||||
LocalDate.of( | ||||||
isoDateTimeUnit.getYear(), isoDateTimeUnit.getMonth(), isoDateTimeUnit.getDay()); | ||||||
return localDate.getDayOfWeek().getValue(); | ||||||
} | ||||||
|
||||||
@Override | ||||||
public int weekday(DateTimeUnit dateTimeUnit) { | ||||||
int dayOfWeek = (isoWeekday(dateTimeUnit) + 1); | ||||||
|
||||||
if (dayOfWeek > 7) { | ||||||
return 1; | ||||||
} | ||||||
|
||||||
return dayOfWeek; | ||||||
return isoWeekday(dateTimeUnit); | ||||||
} | ||||||
|
||||||
@Override | ||||||
|
@@ -461,11 +473,24 @@ private DateInterval toDayIsoInterval(DateTimeUnit dateTimeUnit, int offset, int | |||||
return new DateInterval(from, to, DateIntervalType.ISO8601_DAY); | ||||||
} | ||||||
|
||||||
private int getDayOfYear(DateTimeUnit dateTimeUnit) { | ||||||
int dayOfYear = dateTimeUnit.getDay(); | ||||||
|
||||||
if (CONVERSION_MAP.get(dateTimeUnit.getYear()) != null) { | ||||||
for (int j = 1; j < dateTimeUnit.getMonth(); j++) { | ||||||
dayOfYear += CONVERSION_MAP.get(dateTimeUnit.getYear())[j]; | ||||||
} | ||||||
} | ||||||
return dayOfYear; | ||||||
} | ||||||
|
||||||
// ------------------------------------------------------------------------------------------------------------ | ||||||
// Conversion map for Nepali calendar | ||||||
// | ||||||
// Based on map from: | ||||||
// http://forjavaprogrammers.blogspot.com/2012/06/how-to-convert-english-date-to-nepali.html | ||||||
// http://www.ashesh.com.np | ||||||
// http://nepalicalendar.rat32.com/index.php | ||||||
// http://www.ashesh.com.np/nepali-calendar/ | ||||||
// ------------------------------------------------------------------------------------------------------------ | ||||||
|
||||||
/** | ||||||
|
@@ -475,6 +500,39 @@ private DateInterval toDayIsoInterval(DateTimeUnit dateTimeUnit, int offset, int | |||||
private static final Map<Integer, int[]> CONVERSION_MAP = new HashMap<>(); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? |
||||||
|
||||||
static { | ||||||
CONVERSION_MAP.put(1970, new int[] {0, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(1971, new int[] {0, 31, 31, 32, 31, 32, 30, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(1972, new int[] {0, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31}); | ||||||
CONVERSION_MAP.put(1973, new int[] {0, 30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31}); | ||||||
CONVERSION_MAP.put(1974, new int[] {0, 30, 32, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(1975, new int[] {0, 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(1976, new int[] {0, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31}); | ||||||
CONVERSION_MAP.put(1977, new int[] {0, 30, 32, 31, 32, 31, 31, 29, 30, 29, 30, 29, 31}); | ||||||
CONVERSION_MAP.put(1978, new int[] {0, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(1979, new int[] {0, 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30}); | ||||||
|
||||||
CONVERSION_MAP.put(1980, new int[] {0, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31}); | ||||||
CONVERSION_MAP.put(1981, new int[] {0, 31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(1982, new int[] {0, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(1983, new int[] {0, 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(1984, new int[] {0, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31}); | ||||||
CONVERSION_MAP.put(1985, new int[] {0, 31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(1986, new int[] {0, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(1987, new int[] {0, 31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(1988, new int[] {0, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31}); | ||||||
CONVERSION_MAP.put(1989, new int[] {0, 31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30}); | ||||||
|
||||||
CONVERSION_MAP.put(1990, new int[] {0, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(1991, new int[] {0, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(1992, new int[] {0, 31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31}); | ||||||
CONVERSION_MAP.put(1993, new int[] {0, 31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(1994, new int[] {0, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(1995, new int[] {0, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(1996, new int[] {0, 31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31}); | ||||||
CONVERSION_MAP.put(1997, new int[] {0, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(1998, new int[] {0, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(1999, new int[] {0, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31}); | ||||||
|
||||||
CONVERSION_MAP.put(2000, new int[] {0, 30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31}); | ||||||
CONVERSION_MAP.put(2001, new int[] {0, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(2002, new int[] {0, 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30}); | ||||||
|
@@ -485,6 +543,7 @@ private DateInterval toDayIsoInterval(DateTimeUnit dateTimeUnit, int offset, int | |||||
CONVERSION_MAP.put(2007, new int[] {0, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31}); | ||||||
CONVERSION_MAP.put(2008, new int[] {0, 31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31}); | ||||||
CONVERSION_MAP.put(2009, new int[] {0, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30}); | ||||||
|
||||||
CONVERSION_MAP.put(2010, new int[] {0, 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(2011, new int[] {0, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31}); | ||||||
CONVERSION_MAP.put(2012, new int[] {0, 31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30}); | ||||||
|
@@ -495,6 +554,7 @@ private DateInterval toDayIsoInterval(DateTimeUnit dateTimeUnit, int offset, int | |||||
CONVERSION_MAP.put(2017, new int[] {0, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(2018, new int[] {0, 31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(2019, new int[] {0, 31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31}); | ||||||
|
||||||
CONVERSION_MAP.put(2020, new int[] {0, 31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(2021, new int[] {0, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(2022, new int[] {0, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30}); | ||||||
|
@@ -505,6 +565,7 @@ private DateInterval toDayIsoInterval(DateTimeUnit dateTimeUnit, int offset, int | |||||
CONVERSION_MAP.put(2027, new int[] {0, 30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31}); | ||||||
CONVERSION_MAP.put(2028, new int[] {0, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(2029, new int[] {0, 31, 31, 32, 31, 32, 30, 30, 29, 30, 29, 30, 30}); | ||||||
|
||||||
CONVERSION_MAP.put(2030, new int[] {0, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31}); | ||||||
CONVERSION_MAP.put(2031, new int[] {0, 30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31}); | ||||||
CONVERSION_MAP.put(2032, new int[] {0, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30}); | ||||||
|
@@ -515,6 +576,7 @@ private DateInterval toDayIsoInterval(DateTimeUnit dateTimeUnit, int offset, int | |||||
CONVERSION_MAP.put(2037, new int[] {0, 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(2038, new int[] {0, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31}); | ||||||
CONVERSION_MAP.put(2039, new int[] {0, 31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30}); | ||||||
|
||||||
CONVERSION_MAP.put(2040, new int[] {0, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(2041, new int[] {0, 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(2042, new int[] {0, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31}); | ||||||
|
@@ -525,6 +587,7 @@ private DateInterval toDayIsoInterval(DateTimeUnit dateTimeUnit, int offset, int | |||||
CONVERSION_MAP.put(2047, new int[] {0, 31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(2048, new int[] {0, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(2049, new int[] {0, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30}); | ||||||
|
||||||
CONVERSION_MAP.put(2050, new int[] {0, 31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31}); | ||||||
CONVERSION_MAP.put(2051, new int[] {0, 31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(2052, new int[] {0, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30}); | ||||||
|
@@ -535,6 +598,7 @@ private DateInterval toDayIsoInterval(DateTimeUnit dateTimeUnit, int offset, int | |||||
CONVERSION_MAP.put(2057, new int[] {0, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31}); | ||||||
CONVERSION_MAP.put(2058, new int[] {0, 30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31}); | ||||||
CONVERSION_MAP.put(2059, new int[] {0, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30}); | ||||||
|
||||||
CONVERSION_MAP.put(2060, new int[] {0, 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(2061, new int[] {0, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31}); | ||||||
CONVERSION_MAP.put(2062, new int[] {0, 30, 32, 31, 32, 31, 31, 29, 30, 29, 30, 29, 31}); | ||||||
|
@@ -545,6 +609,7 @@ private DateInterval toDayIsoInterval(DateTimeUnit dateTimeUnit, int offset, int | |||||
CONVERSION_MAP.put(2067, new int[] {0, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(2068, new int[] {0, 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(2069, new int[] {0, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31}); | ||||||
|
||||||
CONVERSION_MAP.put(2070, new int[] {0, 31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(2071, new int[] {0, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(2072, new int[] {0, 31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30}); | ||||||
|
@@ -555,26 +620,29 @@ private DateInterval toDayIsoInterval(DateTimeUnit dateTimeUnit, int offset, int | |||||
CONVERSION_MAP.put(2077, new int[] {0, 31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31}); | ||||||
CONVERSION_MAP.put(2078, new int[] {0, 31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(2079, new int[] {0, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30}); | ||||||
|
||||||
CONVERSION_MAP.put(2080, new int[] {0, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(2081, new int[] {0, 31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31}); | ||||||
CONVERSION_MAP.put(2082, new int[] {0, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(2083, new int[] {0, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(2084, new int[] {0, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31}); | ||||||
CONVERSION_MAP.put(2085, new int[] {0, 30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31}); | ||||||
CONVERSION_MAP.put(2086, new int[] {0, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(2087, new int[] {0, 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(2088, new int[] {0, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31}); | ||||||
CONVERSION_MAP.put(2089, new int[] {0, 30, 32, 31, 32, 31, 31, 29, 30, 29, 30, 29, 31}); | ||||||
CONVERSION_MAP.put(2090, new int[] {0, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(2091, new int[] {0, 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(2092, new int[] {0, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31}); | ||||||
CONVERSION_MAP.put(2093, new int[] {0, 31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31}); | ||||||
CONVERSION_MAP.put(2094, new int[] {0, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(2095, new int[] {0, 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 29}); | ||||||
CONVERSION_MAP.put(2096, new int[] {0, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 32}); | ||||||
CONVERSION_MAP.put(2097, new int[] {0, 31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(2098, new int[] {0, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(2099, new int[] {0, 31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(2100, new int[] {0, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31}); | ||||||
CONVERSION_MAP.put(2081, new int[] {0, 31, 31, 32, 32, 31, 30, 30, 30, 29, 30, 30, 30}); | ||||||
CONVERSION_MAP.put(2082, new int[] {0, 30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30}); | ||||||
CONVERSION_MAP.put(2083, new int[] {0, 31, 31, 32, 31, 31, 30, 30, 30, 29, 30, 30, 30}); | ||||||
CONVERSION_MAP.put(2084, new int[] {0, 31, 31, 32, 31, 31, 30, 30, 30, 29, 30, 30, 30}); | ||||||
CONVERSION_MAP.put(2085, new int[] {0, 31, 32, 31, 32, 30, 31, 30, 30, 29, 30, 30, 30}); | ||||||
CONVERSION_MAP.put(2086, new int[] {0, 30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30}); | ||||||
CONVERSION_MAP.put(2087, new int[] {0, 31, 31, 32, 31, 31, 31, 30, 30, 29, 30, 30, 30}); | ||||||
CONVERSION_MAP.put(2088, new int[] {0, 30, 31, 32, 32, 30, 31, 30, 30, 29, 30, 30, 30}); | ||||||
CONVERSION_MAP.put(2089, new int[] {0, 30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30}); | ||||||
|
||||||
CONVERSION_MAP.put(2090, new int[] {0, 30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30}); | ||||||
CONVERSION_MAP.put(2091, new int[] {0, 31, 31, 32, 31, 31, 31, 30, 30, 29, 30, 30, 30}); | ||||||
CONVERSION_MAP.put(2092, new int[] {0, 31, 31, 32, 32, 31, 30, 30, 30, 29, 30, 30, 30}); | ||||||
CONVERSION_MAP.put(2093, new int[] {0, 31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30}); | ||||||
CONVERSION_MAP.put(2094, new int[] {0, 31, 31, 32, 31, 31, 30, 30, 30, 29, 30, 30, 30}); | ||||||
CONVERSION_MAP.put(2095, new int[] {0, 31, 31, 32, 31, 31, 31, 30, 29, 30, 30, 30, 30}); | ||||||
CONVERSION_MAP.put(2096, new int[] {0, 30, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30}); | ||||||
CONVERSION_MAP.put(2097, new int[] {0, 31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30}); | ||||||
CONVERSION_MAP.put(2098, new int[] {0, 31, 31, 32, 31, 31, 31, 29, 30, 29, 30, 30, 31}); | ||||||
CONVERSION_MAP.put(2099, new int[] {0, 31, 31, 32, 31, 31, 31, 30, 29, 29, 30, 30, 30}); | ||||||
|
||||||
CONVERSION_MAP.put(2100, new int[] {0, 31, 32, 31, 32, 30, 31, 30, 29, 30, 29, 30, 30}); | ||||||
} | ||||||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.