Skip to content

feat(es): support standalone months and ordinal dates - #657

Open
guerrerojuli wants to merge 1 commit into
wanasit:masterfrom
guerrerojuli:feat/es-month-expressions
Open

feat(es): support standalone months and ordinal dates#657
guerrerojuli wants to merge 1 commit into
wanasit:masterfrom
guerrerojuli:feat/es-month-expressions

Conversation

@guerrerojuli

Copy link
Copy Markdown

Summary

Adds a casual-only Spanish month-name parser modeled on the English implementation and integrates Spanish ordinal words through 31 into the existing day-first parser. Preserves numeric dates, ranges, suffixes, and original result text/index.

Behavior

Input Mode Result
septiembre, en septiembre casual September 1 at implied noon
septiembre de 2027 casual September 1, 2027 at implied noon
setiembre, en sep casual September, implied day 1
primero de septiembre casual/strict September 1
trigésimo primero de diciembre casual/strict December 31
Ordinal ranges and ordinal + time existing day-first grammar Complete merged result
Standalone months strict Not parsed

Implicit years use findYearClosestToRef and the common ForwardDateRefiner. Explicit aliases preserve accented and approved ASCII ordinal spellings. Existing numeric symbol suffixes remain supported alongside Spanish letter suffixes. The standalone parser yields to day-first grammar, including rejected invalid dates and compact ranges, to prevent partial month fallbacks.

No month-first parser, normalization, dependencies, generated output, public export changes, or unrelated Spanish grammar is included. This PR is independently based on master, not stacked on the future-expression changes.

Context

Related to #478 and #628. The month-parser structure and ordinal vocabulary adapt the overlapping work proposed by @juansegnana in #628. This smaller contribution adds direct standalone-month tests and wires the vocabulary into the existing little-endian parser without importing the broader configuration refactor or other parsers.

Verification

  • Focused Spanish suites: 2 suites, 9 tests passed.
  • Independent fixture exercises every approved ordinal spelling; suffix/separator tests cover invalid-date fallback and compact ranges.
  • Full coverage suite: 147 suites, 679 tests passed.
  • CommonJS/ESM build, Prettier, git diff check, and pre-commit hooks passed.
  • Independent automated review passed, explicitly checking minimalist code, no unnecessary defensive logic, and repository-pattern alignment.
  • Lint limitation: upstream ESLint 9 cannot load the legacy package configuration. Legacy mode also references the removed prettier/@typescript-eslint export. A temporary corrected legacy configuration produced baseline-only errors (34 errors, 43 warnings); no configuration or dependency changes are included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant