AlexOreshkevich / M-JC1-83-21

GNU General Public License v3.0
2 stars 5 forks source link

HomeTask 6 - Maya Calendar #155

Open AlexOreshkevich opened 3 years ago

AlexOreshkevich commented 3 years ago

Develop Maya Calendar support using Java Date & Time API.

Extend java.time.chrono.AbstractChronology with your custom MayanChronology. Use existing subclasses of AbstractChronology as examples: JapaneseChronology or HijrahChronology would be good ones.

Create custom MayanDate (by analogy to HijrahDate), MayanEra (by analogy to HijrahEra) so on so forth.

Create MayanChronologyTest and demonstrate interoperability of your classes. Define some date in GregorianCalendar (like your birthday or WW2 start date like LocalDate(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.html

Ref: https://en.wikipedia.org/wiki/Maya_calendar

AlexOreshkevich commented 2 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).

AlexOreshkevich commented 2 years ago

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.