Ordinal Date Style Check

This Vale rule enforces the writing convention of avoiding ordinal numbers (like "1st", "2nd", "third") when writing dates. The rule aligns with the Microsoft Style Guide's recommendation for date formatting, which promotes clarity and consistency in technical documentation.

The motivation behind this rule is to maintain a clean, professional style in documentation and to ensure dates are presented in their simplest, most readable format. Using ordinal numbers in dates can make text more cluttered and can cause inconsistencies across different localization efforts.

Examples of what it flags:

✗ Incorrect:

  • January first, 2024
  • Dec twenty-fifth, 2023
  • March third, 2024

✓ Correct:

  • January 1, 2024
  • Dec 25, 2023
  • March 3, 2024

The rule checks for any month name (including abbreviations like "Jan", "Feb", etc.) followed by an ordinal number word, regardless of case. It will flag combinations of month names with any ordinal number from "first" through "thirty-first", including compound forms like "twenty-first".

Rule Source

This rule comes from: https://github.com/mesosphere/dcos-docs-site

Rule Definition

extends: existence
message: "Don't use ordinal numbers for dates."
link: https://docs.microsoft.com/en-us/style-guide/numbers#numbers-in-dates
level: error
nonword: true
ignorecase: true
raw:
  - \b(?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)|May|Jun(?:e)|Jul(?:y)|Aug(?:ust)|Sep(?:tember)?|Oct(?:ober)|Nov(?:ember)?|Dec(?:ember)?)\b\s*
tokens:
  - first
  - second
  - third
  - fourth
  - fifth
  - sixth
  - seventh
  - eighth
  - ninth
  - tenth
  - eleventh
  - twelfth
  - thirteenth
  - fourteenth
  - fifteenth
  - sixteenth
  - seventeenth
  - eighteenth
  - nineteenth
  - twentieth
  - twenty-first
  - twenty-second
  - twenty-third
  - twenty-fourth
  - twenty-fifth
  - twenty-sixth
  - twenty-seventh
  - twenty-eighth
  - twenty-ninth
  - thirtieth
  - thirty-first