The Mel calendar is used in the fictional world of Kaldia. Your goal is to convert dates into the Mel calendar.
This calendar has 13 months of 28 days each, plus 1 or 2 extra days after the last month. A year that is divisible by 4 but not by 100, or divisible by 400 has 366 days, and other years have 365 (i.e. our leap year rules, but with years in the Mel calendar).
You should use the month and day name abbreviations:
months: dia vio lis gil ful dyu mel ral zan pal mik fav ruj
days: dia vio lis gil ful dyu mel ral zan pal mik fav ruj ser rav tan lin rez jil din ket len lax nen pin mat kun mir
The extra days outside of any month have the month name of myuxet
(no abbreviation here), and the day names are axet
and teems
, respectively.
0 dia dia
is 1988/11/30.
You can take the input date as a string or a (year, month, day) tuple; alternatively, for functions, the parameter can be in your standard library's date type. The output should be a space-separated string.
Test cases
1776-07-04 => -213 ral ket
1859-12-15 => -129 dia rav
1917-04-14 => -72 ful nen
1981-02-04 => -8 lis mik
1988-11-30 => 0 dia dia
1988-12-01 => 0 dia vio
1988-12-28 => 0 vio dia
2017-01-01 => 28 vio ful
2019-04-22 => 30 dyu lis
2019-11-30 => 30 myuxet axet
2019-12-01 => 31 dia dia
2021-11-29 => 32 myuxet axet
2021-11-30 => 32 myuxet teems
2089-11-30 => 101 dia dia
2389-11-30 => 400 myuxet teems
You should be able to handle dates from 1 AD to 9999 AD at least.
Reference implementation in Perl 6
Standard loopholes are forbidden.
axet
andteems
are at the end of the year, I was confused until I looked at the link \$\endgroup\$-213 Ral Ket
? \$\endgroup\$