Ever heard about 13.0.0.0.0 and the end of the world? The Maya civilization used to record the passed days from their mythological creation date (11 August 3114BC in the proleptic Gregorian calendar is the most accredited date) with a system that nowadays is called "The Long Count".
Days were recorded in a 5-place counter with a mixed base20 and base18 system. Starting from the left the names and values of the counter-places are:
A complete calendar cycle is equal to 1872000 days (13 Baktun).
The initial total Kin number is equal to the passed days from starting point to the date of interest less 365. Then, for every counter place, the value is obtained dividing the Kin by the corresponding counter-place days value (144000 for Baktun, 7200 for Katun, and so on) with the Kin that at every step becomes the remainder of the division.
Given a date as a string you must return a string representing the Mayan Long Count Date, joining the values of Baktun, Katun, Tun, Uinal and Kin with a dot between them.
getMayanDate("2012, 12, 21") ➞ "13.0.0.0.0"
// Whole part of 1872000 passed days / Baktun = 13, Kin (remainder) is 0
getMayanDate("1776, 7, 4") ➞ "12.8.0.1.13"
// Whole part of 1785633 passed days / Baktun = 12, Kin (remainder) is 57633
// Whole part of Kin / Katun = 8, Kin is now 33.
// Whole part of Kin / Tun = 0, Kin is 33.
// Whole part of Kin / Uinal = 1, Kin is 13.
getMayanDate("1200, 1, 1") ➞ "10.18.15.3.8"