Open AlexOreshkevich opened 3 years ago
Use https://github.com/andymalakov/maya-calendar-android as an example of how encode Maya time units. Some code could be helpful besides the fact the implementation doesn't follow the task requirements (to develop an extension of Java Date & Time API).
Take few dates from table Correlations between Western calendars and the Long Count in here https://en.wikipedia.org/wiki/Mesoamerican_Long_Count_calendar for unit testing purpose and to check yourself. 7.0.0.0.0
should match Thu, Jan 22, 5479 BCE
for example.
Develop Maya Calendar support using Java Date & Time API.
Extend
java.time.chrono.AbstractChronology
with your customMayanChronology
. Use existing subclasses ofAbstractChronology
as examples:JapaneseChronology
orHijrahChronology
would be good ones.Create custom
MayanDate
(by analogy toHijrahDate
),MayanEra
(by analogy toHijrahEra
) so on so forth.Create
MayanChronologyTest
and demonstrate interoperability of your classes. Define some date inGregorianCalendar
(like your birthday or WW2 start date likeLocalDate(09, 01, 1939)
and covert it to Maya date. Use https://docs.oracle.com/javase/tutorial/datetime/iso/nonIso.html as an example of how your unit test demonstration could looks like.Read more about
java.time.chrono.Chronology
here: https://docs.oracle.com/javase/8/docs/api/java/time/chrono/Chronology.htmlRef: https://en.wikipedia.org/wiki/Maya_calendar