@rod2ik/tablesort-date-i18n
v0.2.3
Published
Locale-aware numeric date sorting extensions for Tablesort.
Maintainers
Readme
Tablesort Date i18n
Locale-aware, deterministic numeric date sorting extensions for Tablesort.
The package adds:
date.dmy
date.mdy
date.ymdand resolves automatic data-sort-method="date" headers from explicit configuration or browser locale before Tablesort is initialized.
Install
yarn add tablesort @rod2ik/tablesort-date-i18nimport Tablesort from "tablesort";
import { registerDateSorters, prepareTable } from "@rod2ik/tablesort-date-i18n";
registerDateSorters(Tablesort);
prepareTable(document.querySelector("table"));
new Tablesort(document.querySelector("table"));Browser builds, CommonJS, ESM and TypeScript declarations are included.
Key guarantees
- strict DMY/MDY/YMD parsing;
/,-, and.separators by default;- consistent separator inside one value;
- four-digit years and real calendar-date validation;
- explicit configuration precedence before locale inference;
- no browser-dependent
new Date(localizedString)parsing; - standalone implementation that xTables can consume without duplicating date logic.
Documentation
The full documentation is the canonical reference:
- Installation and browser load order
- Usage and automatic header preparation
- Supported formats and parser rules
- Configuration precedence and locale inference
- Complete API reference and TypeScript surface
- Runtime architecture and sorting/parsing design
- xTables integration
- Troubleshooting
- Development, vendor, testing, GitLab Pages and release workflows
Documentation source lives under site/docs/ and is published at:
https://rod2ik.gitlab.io/tablesort-date-i18n/
Development
corepack enable
yarn install --immutable
python3 -m pip install --break-system-packages -r site/requirements.txt
yarn devThe development site executes the browser bundle built from the current local source. Generated vendor files are synchronized from an explicit whitelist in vendor.config.mjs.
Before pushing:
yarn bfcSee site/docs/development/ for the authoritative workflow and command reference.
Versioning and releases
package.json is the single source of truth for the project version.
A normal push verifies the project and deploys the current default-branch documentation to GitLab Pages. A matching tag:
git tag vX.Y.Z
git push origin vX.Y.Ztriggers verification, npm Trusted Publishing and a GitLab Release. The tag must equal v + package.json.version.
License
GNU GPL version 3 or later.
