Aller au contenu
GitHub

Spec 0.14.0

Malagasy dates: rules and sources

Writes Gregorian dates in Malagasy, reads them back, says the time of day in words, and gives the Malagasy names of months and weekdays.

Ce contenu n’est pas encore disponible dans votre langue.

  1. Input is a calendar date, never a time:

    • text in ISO 8601 form YYYY-MM-DD (2026-11-23), or
    • calendar fields { year, month, day }; ports may also accept their native date type (JavaScript Date, read in its local calendar fields; PHP DateTimeInterface).
  2. Years 1 to 9999. Other years are OUT_OF_RANGE.

  3. Impossible dates (2026-02-30, 2023-02-29): INVALID_FORMAT for text, OUT_OF_RANGE for calendar fields. Text in any other shape (26/06/1960, 2026-1-5, with a time) is INVALID_FORMAT. Anything else is INVALID_TYPE.

  4. Styles (formatDate), default long:

    Style Pattern 2026-11-23
    long d MMMM y 23 Novambra 2026
    full EEEE d MMMM y Alatsinainy 23 Novambra 2026
    medium y MMM d 2026 Nov 23
    short y-MM-dd 2026-11-23
    numeric dd/MM/y 23/11/2026

    Pattern letters: EEEE weekday name, d day, dd two-digit day, MMMM month name, MMM abbreviated month, MM two-digit month, y year. Any other style is INVALID_TYPE.

  5. Reading dates (parseDate): any style of rule 4, so every date formatDate writes reads back: 23 Novambra 2026, 23/11/2026 → { year: 2026, month: 11, day: 23 }. Case and spacing do not matter, and day and month may have one digit (5/7/2026). A full date must name its own weekday. A day that does not exist is INVALID_FORMAT, a year outside 1–9999 OUT_OF_RANGE, text over 64 characters INVALID_FORMAT. With a style, only that style is read. Without one, the styles are tried in the order of rule 4 (long, full, medium, short, numeric) and the first that reads the text wins: 5 Mey 12 is 5 May of year 12 (long), not 12 May of year 5 (medium). Only years up to 31 can read two ways; pass the style to read another one.

  6. Names. Months 1–12, weekdays numbered as in ISO 8601 (Monday 1 … Sunday 7). Width wide (default) or abbreviated; other widths are INVALID_TYPE, other numbers OUT_OF_RANGE.

# Month Abbr. ISO Weekday Abbr.
1 Janoary Jan 1 Alatsinainy Alats
2 Febroary Feb 2 Talata Tal
3 Martsa Mar 3 Alarobia Alar
4 Aprily Apr 4 Alakamisy Alak
5 Mey Mey 5 Zoma Zom
6 Jona Jon 6 Asabotsy Asab
7 Jolay Jol 7 Alahady Alah
8 Aogositra Aog
9 Septambra Sep
10 Oktobra Okt
11 Novambra Nov
12 Desambra Des

Rule 7. Time (spellTime): amin'ny, the hour on a 12-hour clock in words, then sy, the minutes in words (rule 3 of number-words) and minitra, then the part of the day: 14:30 → amin'ny roa sy telopolo minitra tolakandro. On the hour nothing follows the hour: 14:00 → amin'ny roa tolakandro. Every minute is counted; there are no fractions (quarter, third, half) and no counting down to the next hour. Input is HH:MM text (00:00 to 23:59, the hour may have one digit), { hour, minute }, or a port’s native time. Other text is INVALID_FORMAT, an hour outside 0–23 or a minute outside 0–59 OUT_OF_RANGE.

Time Words
02:00 amin'ny roa alina
02:01 amin'ny roa sy iray minitra alina
07:15 amin'ny fito sy dimy ambin'ny folo minitra maraina
14:30 amin'ny roa sy telopolo minitra tolakandro
17:45 amin'ny dimy sy dimy amby efapolo minitra tolakandro

Parts of the day, by the hour: alina 0–3 and 20–23, maraina 4–11, atoandro 12, tolakandro 13–17, hariva 18–19. Noon and midnight are counted like other hours (roa ambin'ny folo): 00:00 → amin'ny roa ambin'ny folo alina.

Rule 8. Reading the time (parseTime): the words spellTime says, in any case and spacing, with or without amin'ny, back to { hour, minute }. Every time of day has its own words. Anything else (no part of the day, other words, the older forms with sasany, fahefany or latsaka, text over 128 characters) is INVALID_FORMAT.

Rule 9. Date and time (spellDateTime): the date in a style of rule 4 (default long), then the time in words of rule 7, joined as CLDR joins them ({date} {time}): 2026-11-23T14:30 → 23 Novambra 2026 amin'ny roa sy telopolo minitra tolakandro. Input is YYYY-MM-DDTHH:MM text (a space may replace the T), { year, month, day, hour, minute }, or a port’s native date and time. The date and the time follow their own rules and errors.

  • Clock time: Malagasy-English/English-Malagasy Dictionary and Phrasebook (J. Rasoloson, Hippocrene), as quoted by Wild Madagascar: Amin'ny roa (2:00), sy dimy (2:05), sy sasany (2:30), Amin'ny telo latsaka fahefany (2:45), latsaka dimy (2:55). Dictionary entries maraina (Amin' ny folo maraina) and hariva (Amin' ny dimy hariva). Parts of the day: Peace Corps Madagascar, Malagasy Language Lessons.

  • Month and weekday names, abbreviations, and the long, full, medium and short patterns: Unicode CLDR 49, locale mg, ca-gregorian.json.

  • Cross-checked with the Malagasy Dictionary: Janoary, Alatsinainy (“andro faharoa amin’ny herinandro”, second day of the week), Alahady (“andro voalohany amin’ny herinandro”, first day of the week).

  • Minutes. The phrasebook (Rasoloson) uses fractions and counts down to the next hour: sy sasany (2:30), telo latsaka fahefany (2:45). The spec counts every minute (sy telopolo minitra, sy dimy amby efapolo minitra), as the project lead decided on 2026-11-29 (rule 7).
  • Minutes and parts of the day (rule 7). The source gives amin'ny and the hour. On 2026-11-29 the project lead set the rest, replacing the decision of 2026-11-27: every minute is counted as sy + the number + minitra (no fahefany, fahatelony, sasany, latsaka or mahery), nothing on the hour, the parts of the day alina 0–3 and 20–23, maraina 4–11, atoandro 12, tolakandro 13–17, hariva 18–19, and noon and midnight counted as roa ambin'ny folo. parseTime reads only this spelling.

  • numeric style dd/MM/y. CLDR mg has no such pattern (its short is y-MM-dd). The project lead asked (2026-11-24) for both: CLDR by default, and dd/MM/y as an option because it is the everyday written form in Madagascar.

  • ISO weekday numbers. The dictionary counts Sunday (Alahady) as the first day of the week; the spec numbers weekdays as ISO 8601 (Monday 1) so every language maps them the same way. Names are unaffected.