Enforce Consistent Dates

Technical documentation should be consistent, and dates are one place where you can have consistency issues. This is especially true if you have authors from different parts of the world who format dates different ways.

This rule enforces a format common in the United States:

extends: existence
message: "Use 'July 31, 2016' format, not '%s'."
ignorecase: true
level: error
nonword: true
tokens:
  - '\d{1,2}(?:\.|/)\d{1,2}(?:\.|/)\d{4}'
  - '\d{1,2} (?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)|May|Jun(?:e)|Jul(?:y)|Aug(?:ust)|Sep(?:tember)?|Oct(?:ober)|Nov(?:ember)?|Dec(?:ember)?) \d{4}'

Modify this rule to ensure the consistency you’d like to see.

Tags:

Found this useful?

Buy the book